diff options
Diffstat (limited to 'completions/zsh')
-rw-r--r-- | completions/zsh/_kontext | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/completions/zsh/_kontext b/completions/zsh/_kontext new file mode 100644 index 0000000..1f2ab78 --- /dev/null +++ b/completions/zsh/_kontext @@ -0,0 +1,17 @@ +#compdef kontext + +__kubectl_context_list() { + local -a ctx_list_disp ctx_list + local expl + IFS=$'\n' ctx_list=($(kubectl config get-contexts -o name)) + _wanted ctx expl 'kubernetes context' compadd "$@" "$ctx_list_disp[@]" - "${(@)ctx_list}" +} + +__kontext() { + _arguments \ + ':ctx arg:__kubectl_context_list' \ + - set1 '-h[help]' \ + - set2 '-n[namespace]' +} + +compdef __kontext kontext |