mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Do not cound "help" as "Available"
This commit is contained in:
parent
42498ec777
commit
24b4b01ffa
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