summaryrefslogtreecommitdiff
path: root/tools/cinder.bash_completion
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@chmouel.com>2012-08-09 14:15:40 +0000
committerChmouel Boudjnah <chmouel@chmouel.com>2012-08-09 14:18:49 +0000
commitac7d98b84f7a5fdfd98df1ffd43da3e5ef110fcf (patch)
treeda60b0662b91029e90554d1ec9c8fe9c50a8d029 /tools/cinder.bash_completion
parent778d2d90227771976f9b98ab686dbe1d88154806 (diff)
downloadpython-cinderclient-ac7d98b84f7a5fdfd98df1ffd43da3e5ef110fcf.tar.gz
Rename bash completion file from nova to cinder.
Change-Id: I4bcdb482149271253e12f43fb85a663b5c938a14
Diffstat (limited to 'tools/cinder.bash_completion')
-rw-r--r--tools/cinder.bash_completion15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/cinder.bash_completion b/tools/cinder.bash_completion
new file mode 100644
index 0000000..060bf1f
--- /dev/null
+++ b/tools/cinder.bash_completion
@@ -0,0 +1,15 @@
+_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