(plugins []configv3.Plugin)
| 96 | } |
| 97 | |
| 98 | func (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 | } |
no test coverage detected