.dotfiles/.local/share/bash-completion/completions/kns
2025-01-30 13:55:36 +00:00

10 lines
248 B
Bash

# vim: ft=bash
function _kns() {
[ "$COMP_CWORD" -ne 1 ] && return
mapfile -t COMPREPLY < <(compgen -W \
"$(kubectl get namespace -o jsonpath='{..metadata.name}')" \
-- "${COMP_WORDS[1]}")
}
complete -o nospace -F _kns kns