MCPcopy Index your code
hub / github.com/cloudfoundry/cli / LongestCommandName

Function LongestCommandName

command/common/internal/help_display.go:55–68  ·  view source on GitHub ↗
(cmds map[string]sharedaction.CommandInfo, pluginCmds []configv3.PluginCommand)

Source from the content-addressed store, hash-verified

53}
54
55func LongestCommandName(cmds map[string]sharedaction.CommandInfo, pluginCmds []configv3.PluginCommand) int {
56 longest := 0
57 for name := range cmds {
58 if len(name) > longest {
59 longest = len(name)
60 }
61 }
62 for _, command := range pluginCmds {
63 if len(command.Name) > longest {
64 longest = len(command.Name)
65 }
66 }
67 return longest
68}
69
70func LongestFlagWidth(flags []sharedaction.CommandFlag) int {
71 longest := 0

Callers 1

displayFullHelpMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected