Files
kubectx/completion/kubectx.zsh
Ahmet Alp Balkan 5d79a0663d Remove message for '-' in kubectx.zsh
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-10-23 23:56:21 -07:00

13 lines
357 B
Bash

#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