blob: 1f2ab787941b67c0a64723337727b6910c962f5e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#compdef kontext
__kubectl_context_list() {
local -a ctx_list_disp ctx_list
local expl
IFS=$'\n' ctx_list=($(kubectl config get-contexts -o name))
_wanted ctx expl 'kubernetes context' compadd "$@" "$ctx_list_disp[@]" - "${(@)ctx_list}"
}
__kontext() {
_arguments \
':ctx arg:__kubectl_context_list' \
- set1 '-h[help]' \
- set2 '-n[namespace]'
}
compdef __kontext kontext
|