mirror of https://github.com/spf13/cobra.git
Merge pull request #150 from eparis/help-not-available
Do not count "help" as "Available"
This commit is contained in:
commit
0d9b07baf9
|
@ -857,6 +857,10 @@ func (c *Command) IsAvailableCommand() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
if c.HasParent() && c.Parent().helpCommand == c {
|
||||
return false
|
||||
}
|
||||
|
||||
if c.Runnable() || c.HasAvailableSubCommands() {
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue