Skip to content

Commit

Permalink
Exit after usage() is shown. Fixes #3583
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Sep 6, 2024
1 parent 8aed3dd commit 75c5ed3
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions cmd/goa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ func main() {
path string
offset int
)
{
if len(os.Args) == 1 {
usage()
}
if len(os.Args) == 1 {
usage()
return
}

switch os.Args[1] {
case "version":
fmt.Println("Goa version " + goa.Version())
os.Exit(0)
case "gen", "example":
if len(os.Args) == 2 {
usage()
}
cmd = os.Args[1]
path = os.Args[2]
offset = 2
default:
switch os.Args[1] {
case "version":
fmt.Println("Goa version " + goa.Version())
os.Exit(0)
case "gen", "example":
if len(os.Args) == 2 {
usage()
return
}
cmd = os.Args[1]
path = os.Args[2]
offset = 2
default:
usage()
return
}

var (
Expand Down

0 comments on commit 75c5ed3

Please sign in to comment.