aboutsummaryrefslogtreecommitdiff
path: root/completions/zsh/_kontext
diff options
context:
space:
mode:
authorChristian Segundo2023-05-21 15:15:49 +0200
committerChristian Segundo2023-05-21 21:34:21 +0200
commit0d927a66dd793e15cd24294ab9f0a7c8b9953e9c (patch)
tree7ce1ecb067d0b51eb237ffed2acd9b2e939d32a8 /completions/zsh/_kontext
parentada36c86a256275fab8400f155ded2815db3836b (diff)
downloadkontext-1.0.0.tar.gz
Add kontext1.0.0
Diffstat (limited to 'completions/zsh/_kontext')
-rw-r--r--completions/zsh/_kontext17
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