fix: improve kubectx completion on fish (#269)

This commit is contained in:
Carlos Alexandro Becker 2020-11-02 02:45:40 -03:00 committed by GitHub
parent 5aba9fa311
commit 8241576f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,10 @@
# kubectx
complete -f -c kubectx -a "- (kubectl config get-contexts --output='name')"
function __fish_kubectx_arg_number -a number
set -l cmd (commandline -opc)
test (count $cmd) -eq $number
end
complete -f -c kubectx
complete -f -x -c kubectx -n '__fish_kubectx_arg_number 1' -a "(kubectl config get-contexts --output='name')"
complete -f -x -c kubectx -n '__fish_kubectx_arg_number 1' -a "-" -d "switch to the previous namespace in this context"