mirror of
https://github.com/spf13/cobra
synced 2024-12-27 14:57:06 +00:00
provide usefull errors when using invalid sub command
This commit is contained in:
parent
10cf7be997
commit
140c5d89f1
1 changed files with 4 additions and 1 deletions
|
@ -766,7 +766,10 @@ func (c *Command) Traverse(args []string) (*Command, []string, error) {
|
|||
|
||||
cmd := c.findNext(arg)
|
||||
if cmd == nil {
|
||||
return c, args, nil
|
||||
if c.Runnable() {
|
||||
return c, args, nil
|
||||
}
|
||||
return c, args, legacyArgs(c, args)
|
||||
}
|
||||
|
||||
if err := c.ParseFlags(flags); err != nil {
|
||||
|
|
Loading…
Reference in a new issue