python-novaclient/tools/nova.bash_completion

16 lines
344 B
Plaintext

_nova()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(nova bash_completion)"
UUID_CACHE=~/.novaclient_cached_*_uuids
opts+=" "$(cat $UUID_CACHE 2> /dev/null | tr '\n' ' ')
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _nova nova