fix(kubectl): load completion properly in functions

Closes #12427
master
Carlo Sala 2 years ago
parent a4424dfefd
commit 2c08d2b842
No known key found for this signature in database
GPG Key ID: DA6FB450C1A4FE9A
  1. 16
      plugins/kubectl/kubectl.plugin.zsh

@ -180,13 +180,11 @@ alias kej='kubectl edit job'
alias kdj='kubectl describe job'
alias kdelj='kubectl delete job'
# Only run if the user actually has kubectl installed
if (( ${+_comps[kubectl]} )); then
function kj() { kubectl "$@" -o json | jq; }
function kjx() { kubectl "$@" -o json | fx; }
function ky() { kubectl "$@" -o yaml | yh; }
compdef kj=kubectl
compdef kjx=kubectl
compdef ky=kubectl
function kj() { kubectl "$@" -o json | jq; }
function kjx() { kubectl "$@" -o json | fx; }
function ky() { kubectl "$@" -o yaml | yh; }
if (( ${+functions[compdef]} )); then
compdef _kubectl kj
compdef _kubectl kjx
compdef _kubectl ky
fi

Loading…
Cancel
Save