Skip to content

Commit

Permalink
exit if no arguments were provided
Browse files Browse the repository at this point in the history
  • Loading branch information
kavishgr committed Mar 1, 2024
1 parent 41828bf commit aba9943
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func main() {
regex = utils.SetRegex(ost, arch)
stdInUrls = make(chan string)
jobs sync.WaitGroup
version = "0.1.0"
)

if token == "" {
Expand All @@ -31,6 +32,12 @@ func main() {
os.Exit(1)
}

if len(os.Args) == 1 {
fmt.Println("No arguments were provided.")
fmt.Println("Run: 'getghrel -h'")
os.Exit(1)
}

go utils.ScanStdIn(stdInUrls)

if opts.List {
Expand Down Expand Up @@ -60,7 +67,7 @@ func main() {

switch {
case opts.Version:
fmt.Println("getghrel version: 0.1.0")
fmt.Println("getghrel version: ", version)

case opts.List:
return
Expand Down

0 comments on commit aba9943

Please sign in to comment.