python-cinderclient/tools/cinder.bash_completion
Chmouel Boudjnah ac7d98b84f Rename bash completion file from nova to cinder.
Change-Id: I4bcdb482149271253e12f43fb85a663b5c938a14
2012-08-09 14:18:49 +00:00

16 lines
361 B
Plaintext

_cinder()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(cinder bash_completion)"
COMPLETION_CACHE=~/.cinderclient/*/*-cache
opts+=" "$(cat $COMPLETION_CACHE 2> /dev/null | tr '\n' ' ')
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _cinder cinder