yage
ab567f6950
===================================================================== --- New Features ------------------------- - Introducing an optional plugin for `kubectl` facilitation! Check out 'plugins/kubectl/README.md' for more details. --- Changes ------------------------------ - The function which lists all available scwrypts now ignores directories with a top-level base called "plugins." If this is a name conflict, you will need to define your own `SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__<group>` function! (ref the changes in 'zsh/lib/scwrypts/run.module.zsh')
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
|