Skip to content

Commit

Permalink
Merge pull request #15 from muzzammilshahid/show-help
Browse files Browse the repository at this point in the history
Print help if no subcommand provided for message and auth
  • Loading branch information
muzzammilshahid authored Jun 29, 2024
2 parents 9695b83 + b159c0f commit a3e3ea2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/wampproto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,16 @@ func parseCmd(args []string) (*cmd, error) {

parsedCommand, err := app.Parse(args[1:])
if err != nil {
if err.Error() == "must select a subcommand of 'message'" {
app.Usage([]string{"message"})
os.Exit(0)
}

if err.Error() == "must select a subcommand of 'auth'" {
app.Usage([]string{"auth"})
os.Exit(0)
}

return nil, err
}
c.parsedCommand = parsedCommand
Expand Down

0 comments on commit a3e3ea2

Please sign in to comment.