From e615d659614339c4df3fcad5c10074a8b72ad89f Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sat, 17 Aug 2019 22:03:38 -0400 Subject: [PATCH] Dynamic completion for 'helm plugin remove/update' Signed-off-by: Marc Khouzam --- cmd/helm/root.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/helm/root.go b/cmd/helm/root.go index f1ec2bac7..090879352 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -73,6 +73,14 @@ __helm_list_repos() COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) fi } +__helm_list_plugins() +{ + __helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + local out + if out=$(helm plugin list | tail +2 | cut -f1 2>/dev/null); then + COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) + fi +} __helm_custom_func() { __helm_debug "${FUNCNAME[0]}: last_command is $last_command" @@ -85,6 +93,9 @@ __helm_custom_func() helm_repo_remove) __helm_list_repos ;; + helm_plugin_remove | helm_plugin_update) + __helm_list_plugins + ;; *) ;; esac