MCPcopy
hub / github.com/spf13/cobra / HasHelpSubCommands

Method HasHelpSubCommands

command.go:1648–1658  ·  view source on GitHub ↗

HasHelpSubCommands determines if a command has any available 'help' sub commands that need to be shown in the usage/help default template under 'additional help topics'.

()

Source from the content-addressed store, hash-verified

1646// that need to be shown in the usage/help default template under 'additional help
1647// topics'.
1648func (c *Command) HasHelpSubCommands() bool {
1649 // return true on the first found available 'help' sub command
1650 for _, sub := range c.commands {
1651 if sub.IsAdditionalHelpTopicCommand() {
1652 return true
1653 }
1654 }
1655
1656 // the command either has no sub commands, or no available 'help' sub commands
1657 return false
1658}
1659
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'.

Callers 1

defaultUsageFuncFunction · 0.80

Calls 1

Tested by

no test coverage detected