Skip to content

Commit

Permalink
Don't return help for commands with no arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
willdollman committed Oct 15, 2024
1 parent 847a899 commit a46fce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/src/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (c commander) run(flagSet *flag.FlagSet, cmdName, usageText string, args []
}

// Show usage examples for subcommand
if len(args) == 0 || slices.IndexFunc(args, func(s string) bool {
if slices.IndexFunc(args, func(s string) bool {
return s == "help" || s == "--help"
}) >= 0 {
cmd.flagSet.SetOutput(os.Stdout)
Expand Down

0 comments on commit a46fce7

Please sign in to comment.