HasAvailableSubCommands determines if a command has available sub commands that need to be shown in the usage/help default template under 'available commands'.
()
| 1660 | // HasAvailableSubCommands determines if a command has available sub commands that |
| 1661 | // need to be shown in the usage/help default template under 'available commands'. |
| 1662 | func (c *Command) HasAvailableSubCommands() bool { |
| 1663 | // return true on the first found available (non deprecated/help/hidden) |
| 1664 | // sub command |
| 1665 | for _, sub := range c.commands { |
| 1666 | if sub.IsAvailableCommand() { |
| 1667 | return true |
| 1668 | } |
| 1669 | } |
| 1670 | |
| 1671 | // the command either has no sub commands, or no available (non deprecated/help/hidden) |
| 1672 | // sub commands |
| 1673 | return false |
| 1674 | } |
| 1675 | |
| 1676 | // HasParent determines if the command is a child command. |
| 1677 | func (c *Command) HasParent() bool { |
no test coverage detected