mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Merge pull request #150 from eparis/help-not-available
Do not count "help" as "Available"
This commit is contained in:
commit
0d9b07baf9
1 changed files with 4 additions and 0 deletions
|
@ -857,6 +857,10 @@ func (c *Command) IsAvailableCommand() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.HasParent() && c.Parent().helpCommand == c {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if c.Runnable() || c.HasAvailableSubCommands() {
|
if c.Runnable() || c.HasAvailableSubCommands() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue