sam: Echo command/context on k
This commit is contained in:
parent
a0a3e0f720
commit
052854db38
1 changed files with 10 additions and 1 deletions
|
|
@ -142,7 +142,16 @@
|
|||
initExtra = ''
|
||||
# https://kubernetes.io/docs/reference/kubectl/quick-reference/#bash
|
||||
source <(kubectl completion bash)
|
||||
alias k=kubectl
|
||||
k() {
|
||||
if [[ -t 1 ]]; then # stdout is a terminal
|
||||
tput dim # Konsole's default theme requires some adjustment
|
||||
printf "$ kubectl --context %q" "$(kubectl config current-context 2>/dev/null)"
|
||||
printf " %q" "$@"
|
||||
echo
|
||||
tput sgr0
|
||||
fi
|
||||
kubectl "$@"
|
||||
}
|
||||
complete -o default -F __start_kubectl k
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue