mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
order
This commit is contained in:
parent
55707b20f2
commit
981fa24569
1 changed files with 10 additions and 11 deletions
|
@ -709,18 +709,17 @@ func (c *Command) findAndParseFlag(args []string) (*Command, error) {
|
|||
}
|
||||
cmd := c.findNext(nextSubCmd)
|
||||
|
||||
if cmd != nil {
|
||||
// initialize help and version flag at the last point possible to allow for user
|
||||
// overriding
|
||||
cmd.InitDefaultHelpFlag()
|
||||
cmd.InitDefaultVersionFlag()
|
||||
|
||||
c.parsePersistentFlags(beforeFlags)
|
||||
|
||||
// err = c.ParseFlags(a)
|
||||
// if err != nil {
|
||||
// return c.FlagErrorFunc()(c, err)
|
||||
// }
|
||||
if cmd != nil {
|
||||
return innerfind(cmd, afterArgs)
|
||||
}
|
||||
return c, innerArgs
|
||||
|
|
Loading…
Add table
Reference in a new issue