MCPcopy Index your code
hub / github.com/helm/helm / compListPlugins

Function compListPlugins

pkg/cmd/plugin_list.go:98–117  ·  view source on GitHub ↗

Provide dynamic auto-completion for plugin names

(_ string, ignoredPluginNames []string)

Source from the content-addressed store, hash-verified

96
97// Provide dynamic auto-completion for plugin names
98func compListPlugins(_ string, ignoredPluginNames []string) []string {
99 var pNames []string
100 dirs := filepath.SplitList(settings.PluginsDirectory)
101 descriptor := plugin.Descriptor{
102 Type: "cli/v1",
103 }
104 plugins, err := plugin.FindPlugins(dirs, descriptor)
105 if err == nil && len(plugins) > 0 {
106 filteredPlugins := filterPlugins(plugins, ignoredPluginNames)
107 for _, p := range filteredPlugins {
108 m := p.Metadata()
109 var shortHelp string
110 if config, ok := m.Config.(*schema.ConfigCLIV1); ok {
111 shortHelp = config.ShortHelp
112 }
113 pNames = append(pNames, fmt.Sprintf("%s\t%s", p.Metadata().Name, shortHelp))
114 }
115 }
116 return pNames
117}

Callers 2

newPluginUninstallCmdFunction · 0.85
newPluginUpdateCmdFunction · 0.85

Calls 3

FindPluginsFunction · 0.92
filterPluginsFunction · 0.85
MetadataMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…