MCPcopy
hub / github.com/cloudfoundry/cli / displayPluginCommands

Method displayPluginCommands

command/plugin/plugins_command.go:98–116  ·  view source on GitHub ↗
(plugins []configv3.Plugin)

Source from the content-addressed store, hash-verified

96}
97
98func (cmd PluginsCommand) displayPluginCommands(plugins []configv3.Plugin) error {
99 cmd.UI.DisplayText("Listing installed plugins...")
100 table := [][]string{{"plugin", "version", "command name", "command help"}}
101 for _, plugin := range plugins {
102 for _, command := range plugin.PluginCommands() {
103 table = append(table, []string{plugin.Name, plugin.Version.String(), command.CommandName(), command.HelpText})
104 }
105 }
106 cmd.UI.DisplayNewline()
107 cmd.UI.DisplayTableWithHeader("", table, ui.DefaultTableSpacePadding)
108
109 cmd.UI.DisplayNewline()
110 cmd.UI.DisplayText("Use '{{.BinaryName}} repo-plugins' to list plugins in registered repos available to install.",
111 map[string]interface{}{
112 "BinaryName": cmd.Config.BinaryName(),
113 })
114
115 return nil
116}

Callers 1

ExecuteMethod · 0.95

Calls 7

PluginCommandsMethod · 0.80
CommandNameMethod · 0.80
DisplayTextMethod · 0.65
StringMethod · 0.65
DisplayNewlineMethod · 0.65
BinaryNameMethod · 0.65

Tested by

no test coverage detected