feat(helm): Complete for helm plugin remove/update

helm repo remove <TAB> (will select from the names of configured repos)
helm plugin remove <TAB> (will select from names of installed plugins)
helm plugin update <TAB> (will select from names of installed plugins)

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
pull/6265/head
Marc Khouzam 6 years ago
parent 163038dd38
commit 53c836375d

@ -80,7 +80,6 @@ __helm_list_releases()
fi fi
} }
__helm_list_repos() __helm_list_repos()
{ {
__helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
@ -92,6 +91,17 @@ __helm_list_repos()
fi fi
} }
__helm_list_plugins()
{
__helm_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
local out oflags
oflags=$(__helm_override_flags)
__helm_debug "${FUNCNAME[0]}: __helm_override_flags are ${oflags}"
if out=$(helm plugin list ${oflags} | tail +2 | cut -f1 2>/dev/null); then
COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
fi
}
__helm_custom_func() __helm_custom_func()
{ {
__helm_debug "${FUNCNAME[0]}: c is $c words[@] is ${words[@]}" __helm_debug "${FUNCNAME[0]}: c is $c words[@] is ${words[@]}"
@ -105,6 +115,10 @@ __helm_custom_func()
__helm_list_repos __helm_list_repos
return return
;; ;;
helm_plugin_remove | helm_plugin_update)
__helm_list_plugins
return
;;
*) *)
;; ;;
esac esac

Loading…
Cancel
Save