python-manilaclient/tools/cinder.bash_completion
Ben Swartzlander 5e9ada9fc6 Initial checkin
2013-09-02 23:42:41 -04: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