From 0d927a66dd793e15cd24294ab9f0a7c8b9953e9c Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 21 May 2023 15:15:49 +0200 Subject: Add kontext --- completions/zsh/_kontext | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 completions/zsh/_kontext (limited to 'completions') 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 -- cgit v1.2.3