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

Method displayAllCommands

command/common/help_command.go:93–106  ·  view source on GitHub ↗
(pluginCommands []configv3.PluginCommand, cmdInfo map[string]sharedaction.CommandInfo, longestCmd int)

Source from the content-addressed store, hash-verified

91}
92
93func (cmd HelpCommand) displayAllCommands(pluginCommands []configv3.PluginCommand, cmdInfo map[string]sharedaction.CommandInfo, longestCmd int) {
94 cmd.displayCommandGroups(internal.HelpCategoryList, cmdInfo, longestCmd)
95 cmd.UI.DisplayNewline()
96
97 cmd.UI.DisplayHeader("INSTALLED PLUGIN COMMANDS:")
98 for _, pluginCommand := range pluginCommands {
99 cmd.UI.DisplayText(sharedaction.AllCommandsIndent+"{{.CommandName}}{{.Gap}}{{.CommandDescription}}", map[string]interface{}{
100 "CommandName": pluginCommand.Name,
101 "CommandDescription": pluginCommand.HelpText,
102 "Gap": strings.Repeat(" ", longestCmd+1-len(pluginCommand.Name)),
103 })
104 }
105 cmd.UI.DisplayNewline()
106}
107
108func (cmd HelpCommand) displayCommandGroups(commandGroupList []internal.HelpCategory, cmdInfo map[string]sharedaction.CommandInfo, longestCmd int) {
109 for i, category := range commandGroupList {

Callers 1

displayFullHelpMethod · 0.95

Calls 4

displayCommandGroupsMethod · 0.95
DisplayNewlineMethod · 0.65
DisplayHeaderMethod · 0.65
DisplayTextMethod · 0.65

Tested by

no test coverage detected