mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +00:00
move helpverb default higher in the execute stack
This commit is contained in:
parent
191297c568
commit
64bd4318af
1 changed files with 5 additions and 5 deletions
10
command.go
10
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)
|
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
|
// initialize help and version flag at the last point possible to allow for user
|
||||||
// overriding
|
// overriding
|
||||||
c.InitDefaultHelpFlag()
|
c.InitDefaultHelpFlag()
|
||||||
|
@ -821,6 +816,11 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||||
preExecHookFn(c)
|
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
|
// initialize help as the last point possible to allow for user
|
||||||
// overriding
|
// overriding
|
||||||
c.InitDefaultHelpCmd()
|
c.InitDefaultHelpCmd()
|
||||||
|
|
Loading…
Add table
Reference in a new issue