Update pkg/cmd/plugin_update.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
This commit is contained in:
MrJack 2026-02-24 16:44:47 +01:00
parent b13f5de34d
commit ffec80f505

View file

@ -57,7 +57,12 @@ func newPluginUpdateCmd(out io.Writer) *cobra.Command {
Short: "update one or more Helm plugins",
Long: pluginUpdateDesc,
ValidArgsFunction: func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return compListPlugins(toComplete, args), cobra.ShellCompDirectiveNoFileComp
ignoredNames := make([]string, len(args))
for i, arg := range args {
name, _ := parsePluginVersion(arg)
ignoredNames[i] = name
}
return compListPlugins(toComplete, ignoredNames), cobra.ShellCompDirectiveNoFileComp
},
PreRunE: func(_ *cobra.Command, args []string) error {
return o.complete(args)