From 64bd4318af78fd6dd0ad86f05ba5020520ba3ee6 Mon Sep 17 00:00:00 2001 From: Chase Hutchins Date: Thu, 24 Jan 2019 13:56:59 -0700 Subject: [PATCH] move helpverb default higher in the execute stack --- command.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/command.go b/command.go index 46d46003..4b85f013 100644 --- a/command.go +++ b/command.go @@ -684,11 +684,6 @@ func (c *Command) execute(a []string) (err error) { c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated) } - // Set the help verb to "help" if a custom word is not defined. - if len(c.HelpVerb) == 0 { - c.HelpVerb = "help" - } - // initialize help and version flag at the last point possible to allow for user // overriding c.InitDefaultHelpFlag() @@ -821,6 +816,11 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { preExecHookFn(c) } + // Set the help verb to "help" if a custom word is not defined. + if len(c.HelpVerb) == 0 { + c.HelpVerb = "help" + } + // initialize help as the last point possible to allow for user // overriding c.InitDefaultHelpCmd()