mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
parent
8127e5838c
commit
a3d04b7164
1 changed files with 8 additions and 20 deletions
|
|
@ -180,23 +180,11 @@ alias kej='kubectl edit job'
|
||||||
alias kdj='kubectl describe job'
|
alias kdj='kubectl describe job'
|
||||||
alias kdelj='kubectl delete job'
|
alias kdelj='kubectl delete job'
|
||||||
|
|
||||||
# Utility print functions (json / yaml)
|
function kj() { kubectl "$@" -o json | jq; }
|
||||||
function _build_kubectl_out_alias {
|
function kjx() { kubectl "$@" -o json | fx; }
|
||||||
setopt localoptions norcexpandparam
|
function ky() { kubectl "$@" -o yaml | yh; }
|
||||||
|
if (( ${+functions[compdef]} )); then
|
||||||
# alias function
|
compdef _kubectl kj
|
||||||
eval "function $1 { $2 }"
|
compdef _kubectl kjx
|
||||||
|
compdef _kubectl ky
|
||||||
# completion function
|
fi
|
||||||
eval "function _$1 {
|
|
||||||
words=(kubectl \"\${words[@]:1}\")
|
|
||||||
_kubectl
|
|
||||||
}"
|
|
||||||
|
|
||||||
compdef _$1 $1
|
|
||||||
}
|
|
||||||
|
|
||||||
_build_kubectl_out_alias "kj" 'kubectl "$@" -o json | jq'
|
|
||||||
_build_kubectl_out_alias "kjx" 'kubectl "$@" -o json | fx'
|
|
||||||
_build_kubectl_out_alias "ky" 'kubectl "$@" -o yaml | yh'
|
|
||||||
unfunction _build_kubectl_out_alias
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue