IsAvailableCommand determines if a command is available as a non-help command (this includes all non deprecated/hidden commands).
()
| 1605 | // IsAvailableCommand determines if a command is available as a non-help command |
| 1606 | // (this includes all non deprecated/hidden commands). |
| 1607 | func (c *Command) IsAvailableCommand() bool { |
| 1608 | if len(c.Deprecated) != 0 || c.Hidden { |
| 1609 | return false |
| 1610 | } |
| 1611 | |
| 1612 | if c.HasParent() && c.Parent().helpCommand == c { |
| 1613 | return false |
| 1614 | } |
| 1615 | |
| 1616 | if c.Runnable() || c.HasAvailableSubCommands() { |
| 1617 | return true |
| 1618 | } |
| 1619 | |
| 1620 | return false |
| 1621 | } |
| 1622 | |
| 1623 | // IsAdditionalHelpTopicCommand determines if a command is an additional |
| 1624 | // help topic command; additional help topic command is determined by the |