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

Method Name

command.go:1541–1548  ·  command.go::Command.Name

Name returns the command's name: the first word in the use line.

()

Source from the content-addressed store, hash-verified

1539
1540// Name returns the command's name: the first word in the use line.
1541func (c *Command) Name() string {
1542 name := c.Use
1543 i := strings.Index(name, " ")
1544 if i >= 0 {
1545 name = name[:i]
1546 }
1547 return name
1548}
1549
1550// HasAlias determines if a given string is an alias of the command.
1551func (c *Command) HasAlias(s string) bool {

Callers 15

GenFishCompletionMethod · 0.95
genBashCompletionMethod · 0.95
TestConfigActiveHelpFunction · 0.95
TestDisableActiveHelpFunction · 0.95
genZshCompletionMethod · 0.95
TestDisableDescriptionsFunction · 0.95
GenBashCompletionMethod · 0.95
TestBashCompletionsFunction · 0.95

Calls

no outgoing calls