From c2d19e9c4338e36a2f2176537a4f67b3ee59f4e7 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Tue, 1 Sep 2015 14:10:55 -0400 Subject: [PATCH] Use the HelpFunc for the --help flag 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. --- command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.go b/command.go index 5bb30582..4ff14b2d 100644 --- a/command.go +++ b/command.go @@ -582,7 +582,7 @@ func (c *Command) Execute() (err error) { err = cmd.execute(flags) if err != nil { if err == flag.ErrHelp { - cmd.Help() + cmd.HelpFunc()(cmd, args) return nil } c.Println(cmd.UsageString())