yage
2034325ac9
===================================================================== --- Changes ------------------------------ - Adjusted USAGE (from zsh/lib/utils/io.zsh) to allow dynamic variable insertion in help dialogues by setting USAGE__<help-group> and using the syntax listed - Various quality-of-life changes and and fixes to experimental kubectl plugin --- Bug fixes ---------------------------- - sourcing 'scwrypts.plugin.zsh' no longer sets __SCWRYPT=1 in your current environment
32 lines
737 B
Bash
32 lines
737 B
Bash
#####################################################################
|
|
command -v compdef >/dev/null 2>&1 || return 0
|
|
#####################################################################
|
|
|
|
_k() {
|
|
local C=$(k meta get context)
|
|
local NS=$(k meta get namespace)
|
|
|
|
local KUBEWORDS=(kubectl)
|
|
[ $C ] && KUBEWORDS+=(--context $C)
|
|
[ $NS ] && KUBEWORDS+=(--namespace $NS)
|
|
|
|
words="$KUBEWORDS ${words[@]:1}"
|
|
_kubectl
|
|
}
|
|
|
|
compdef _k k
|
|
|
|
#####################################################################
|
|
_h() {
|
|
local C=$(k meta get context)
|
|
local NS=$(k meta get namespace)
|
|
|
|
local KUBEWORDS=(kubectl)
|
|
[ $C ] && KUBEWORDS+=(--context $C)
|
|
[ $NS ] && KUBEWORDS+=(--namespace $NS)
|
|
|
|
words="$KUBEWORDS ${words[@]:1}"
|
|
_helm
|
|
}
|
|
compdef _h h
|