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

Method DisplayName

command.go:1474–1479  ·  view source on GitHub ↗

DisplayName returns the name to display in help text. Returns command Name() If CommandDisplayNameAnnoation is not set

()

Source from the content-addressed store, hash-verified

1472// DisplayName returns the name to display in help text. Returns command Name()
1473// If CommandDisplayNameAnnoation is not set
1474func (c *Command) DisplayName() string {
1475 if displayName, ok := c.Annotations[CommandDisplayNameAnnotation]; ok {
1476 return displayName
1477 }
1478 return c.Name()
1479}
1480
1481// UseLine puts out the full usage for a given command (including parents).
1482func (c *Command) UseLine() string {

Callers 13

InitDefaultHelpFlagMethod · 0.95
InitDefaultHelpCmdMethod · 0.95
CommandPathMethod · 0.95
UseLineMethod · 0.95
FlagsMethod · 0.95
LocalFlagsMethod · 0.95
InheritedFlagsMethod · 0.95
PersistentFlagsMethod · 0.95
ResetFlagsMethod · 0.95
updateParentsPflagsMethod · 0.95

Calls 1

NameMethod · 0.95

Tested by

no test coverage detected