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

Method AllChildCommandsHaveGroup

command.go:1376–1383  ·  view source on GitHub ↗

AllChildCommandsHaveGroup returns if all subcommands are assigned to a group

()

Source from the content-addressed store, hash-verified

1374
1375// AllChildCommandsHaveGroup returns if all subcommands are assigned to a group
1376func (c *Command) AllChildCommandsHaveGroup() bool {
1377 for _, sub := range c.commands {
1378 if (sub.IsAvailableCommand() || sub == c.helpCommand) && sub.GroupID == "" {
1379 return false
1380 }
1381 }
1382 return true
1383}
1384
1385// ContainsGroup return if groupID exists in the list of command groups.
1386func (c *Command) ContainsGroup(groupID string) bool {

Callers 1

defaultUsageFuncFunction · 0.80

Calls 1

IsAvailableCommandMethod · 0.80

Tested by

no test coverage detected