summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-07-12 23:57:19 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-07-12 23:57:19 -0300
commit0ee3a24aa0accb020645171a8368635ef5b181e6 (patch)
treea844d0f91936f1fd0ff2fed68fceb9f61be4ee0f
parent4dbc4294a0bc9b963bc79e4d5da08a26788f8adc (diff)
downloadhydra-0ee3a24aa0accb020645171a8368635ef5b181e6.tar.gz
hydra-0ee3a24aa0accb020645171a8368635ef5b181e6.tar.bz2
Adding bash completion skeleton
-rw-r--r--lib/hydra/completions/bash31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/hydra/completions/bash b/lib/hydra/completions/bash
new file mode 100644
index 0000000..a416c78
--- /dev/null
+++ b/lib/hydra/completions/bash
@@ -0,0 +1,31 @@
+#
+# Hydra Suite bash completion
+#
+
+_hydra() {
+ # Standard stuff
+ local cur prev opts config
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ # Initial options
+ config="$HOME/.hydra"
+ opts="`ls $config | sed -e 's/config//'`"
+
+ # Available instances
+ instances="`echo $opts | sed -e 's/ /|/'`"
+
+ # The current instance
+ instance="${COMP_WORDS[1]}"
+
+ # Return the available options
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+}
+
+_hydractl() {
+}
+
+complete -F _hydra hydra
+complete -F _hydractl hydractl