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

Method findPlugin

command/common/help_command.go:336–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334}
335
336func (cmd HelpCommand) findPlugin() (sharedaction.CommandInfo, bool) {
337 for _, pluginConfig := range cmd.Config.Plugins() {
338 for _, command := range pluginConfig.Commands {
339 if command.Name == cmd.OptionalArgs.CommandName ||
340 command.Alias == cmd.OptionalArgs.CommandName {
341 return internal.ConvertPluginToCommandInfo(command), true
342 }
343 }
344 }
345
346 return sharedaction.CommandInfo{}, false
347}
348
349func (cmd HelpCommand) getSortedPluginCommands() []configv3.PluginCommand {
350 plugins := cmd.Config.Plugins()

Callers 1

displayCommandMethod · 0.95

Calls 2

PluginsMethod · 0.65

Tested by

no test coverage detected