From 5d403b5a0a82a307faf76c6cdb32fa0b2932e117 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sat, 17 Aug 2019 20:14:59 -0400 Subject: [PATCH] Add dynamic completion for 'helm repo remove' 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 83117b87d..e795f3663 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -65,6 +65,14 @@ __helm_list_releases() COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) fi } +__helm_list_repos() +{ + __helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" + local out + if out=$(helm repo 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" @@ -73,6 +81,9 @@ __helm_custom_func() helm_upgrade | helm_rollback | helm_get_*) __helm_list_releases return + ;; + helm_repo_remove) + __helm_list_repos ;; *) ;;