Skip to content
Myr

Use the HelpFunc for the --help flag

Before adoption: this commit came in with the history the project adopted, so no landing records it.

We were just calling Help() when a user set the --help flag. You could overwrite how the help subcommand worked with SetHelpFunc, but not now the --help flag worked.

authored by Eric Paris · committed by Eric Paris · parent 27bf248 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:command.go+1 added-1 removed
580 unmodified lines
581582 err = cmd.execute(flags)583 if err != nil {584 if err == flag.ErrHelp {585 cmd.Help()585 cmd.HelpFunc()(cmd, args)586 return nil587 }588 c.Println(cmd.UsageString())589 c.Println("Error:", err.Error())
489 unmodified lines