This commit is contained in:
Almog Baku 2025-01-23 12:07:06 -05:00 committed by GitHub
commit 8c6a174fd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -10,11 +10,11 @@ if [ -f "$KUBECTX" ]; then
# show '-' only if there's a saved previous context
local PREV=$(cat "${KUBECTX}")
_arguments \
_arguments >/dev/null 2>&1 \
"-d:*: :(${all_contexts})" \
"(- *): :(- ${all_contexts})"
else
_arguments \
_arguments >/dev/null 2>&1 \
"-d:*: :(${all_contexts})" \
"(- *): :(${all_contexts})"
fi

View File

@ -1,2 +1,2 @@
#compdef kubens kns=kubens
_arguments "1: :(- $(kubectl get namespaces -o=jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}'))"
_arguments >/dev/null 2>&1 "1: :(- $(kubectl get namespaces -o=jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}'))"