mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
InitDefaultHelpFlag
This commit is contained in:
parent
8b3a405da9
commit
8e3ac9400a
1 changed files with 2 additions and 0 deletions
|
@ -712,6 +712,8 @@ func (c *Command) findAndParseFlag(args []string) (*Command, error) {
|
|||
innerfind = func(c *Command, innerArgs []string) (*Command, []string) {
|
||||
beforeFlags, nextSubCmd, afterArgs := splitFirstWord(innerArgs, c)
|
||||
if nextSubCmd == nil {
|
||||
c.InitDefaultHelpFlag()
|
||||
c.InitDefaultVersionFlag()
|
||||
c.ParseFlags(innerArgs)
|
||||
return c, innerArgs
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue