Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@ahmetb @swestcott
13 lines (11 sloc) 353 Bytes
#compdef kubectx kctx=kubectx
local KUBECTX="${HOME}/.kube/kubectx"
PREV=""
if [ -f "$KUBECTX" ]; then
# show '-' only if there's a saved previous context
local PREV=$(cat "${KUBECTX}")
_arguments "1: :(-
$(kubectl config get-contexts --output='name'))"
else
_arguments "1: :($(kubectl config get-contexts --output='name'))"
fi
You can’t perform that action at this time.