mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-10-22 03:30:40 +00:00
Fixes #1. Now kubectx also ships with kubens. Extracted utility functions to a utils.bash file, loaded from ../include/utils.bash. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
9 lines
250 B
Bash
9 lines
250 B
Bash
_kube_namespaces()
|
|
{
|
|
local curr_arg;
|
|
curr_arg=${COMP_WORDS[COMP_CWORD]}
|
|
COMPREPLY=( $(compgen -W "- $(kubectl get namespaces -o=jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}')" -- $curr_arg ) );
|
|
}
|
|
|
|
complete -F _kube_namespaces kubens
|