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

Method displayCommandGroups

command/common/help_command.go:108–127  ·  view source on GitHub ↗
(commandGroupList []internal.HelpCategory, cmdInfo map[string]sharedaction.CommandInfo, longestCmd int)

Source from the content-addressed store, hash-verified

106}
107
108func (cmd HelpCommand) displayCommandGroups(commandGroupList []internal.HelpCategory, cmdInfo map[string]sharedaction.CommandInfo, longestCmd int) {
109 for i, category := range commandGroupList {
110 cmd.UI.DisplayHeader(category.CategoryName)
111
112 for j, row := range category.CommandList {
113 for _, command := range row {
114 cmd.UI.DisplayText(sharedaction.AllCommandsIndent+"{{.CommandName}}{{.Gap}}{{.CommandDescription}}",
115 map[string]interface{}{
116 "CommandName": cmdInfo[command].Name,
117 "CommandDescription": cmd.UI.TranslateText(cmdInfo[command].Description),
118 "Gap": strings.Repeat(" ", longestCmd+1-len(command)),
119 })
120 }
121
122 if j < len(category.CommandList)-1 || i < len(commandGroupList)-1 {
123 cmd.UI.DisplayNewline()
124 }
125 }
126 }
127}
128
129func (cmd HelpCommand) displayHelpFooter(cmdInfo map[string]sharedaction.CommandInfo) {
130 cmd.UI.DisplayHeader("ENVIRONMENT VARIABLES:")

Callers 1

displayAllCommandsMethod · 0.95

Calls 4

DisplayHeaderMethod · 0.65
DisplayTextMethod · 0.65
TranslateTextMethod · 0.65
DisplayNewlineMethod · 0.65

Tested by

no test coverage detected