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

Method IsAvailableCommand

command.go:1607–1621  ·  view source on GitHub ↗

IsAvailableCommand determines if a command is available as a non-help command (this includes all non deprecated/hidden commands).

()

Source from the content-addressed store, hash-verified

1605// IsAvailableCommand determines if a command is available as a non-help command
1606// (this includes all non deprecated/hidden commands).
1607func (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

Callers 15

getCompletionsMethod · 0.80
writeCommandsFunction · 0.80
genFunction · 0.80
SuggestionsForMethod · 0.80
InitDefaultHelpCmdMethod · 0.80
defaultUsageFuncFunction · 0.80
GenManTreeFromOptsFunction · 0.80
genManFunction · 0.80
GenYamlTreeCustomFunction · 0.80

Calls 4

HasParentMethod · 0.95
ParentMethod · 0.95
RunnableMethod · 0.95

Tested by 1