Allows a user to interact with certain models (image, flavors, and
servers currently) using a human-friendly identifier which is a
slugified form of the model name.
Example:
nova boot --image debian-6-squeeze --flavor 256mb-instance myinst
Change-Id: I43dbedac3493d010c1ec9ba8b8bb1007ff7ac499
16 lines
351 B
Plaintext
16 lines
351 B
Plaintext
_nova()
|
|
{
|
|
local cur prev opts
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
opts="$(nova bash_completion)"
|
|
|
|
COMPLETION_CACHE=~/.novaclient/*/*-cache
|
|
opts+=" "$(cat $COMPLETION_CACHE 2> /dev/null | tr '\n' ' ')
|
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
}
|
|
complete -F _nova nova
|