summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2010-01-08 23:47:41 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2010-01-08 23:47:41 +0100
commit81fd5191005bf7575e64737d61a6559e6342a838 (patch)
tree9f8ed755d8370fa4327fac4cf003c6067c444520 /priv
parent4ac1f3efe9fd358774bf8f1166202d6234afc2b1 (diff)
Added first version of a bash-completion script
Diffstat (limited to 'priv')
-rw-r--r--priv/shell-completion/bash/rebar36
1 files changed, 36 insertions, 0 deletions
diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar
new file mode 100644
index 0000000..33997b8
--- /dev/null
+++ b/priv/shell-completion/bash/rebar
@@ -0,0 +1,36 @@
+# bash completion for rebar
+
+#have rebar &&
+_rebar()
+{
+ local cur prev opts
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ sopts="-h -v -f -j"
+ lopts=" --help --verbose --force --jobs="
+ cmdsnvars="analyze build_plt clean compile create-app \
+ create-app create-node eunit generate \
+ int_test perf_test test \
+ case= force=1 suite= verbose=1"
+
+ if [[ ${cur} == --* ]] ; then
+ COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
+ return 0
+ elif [[ ${cur} == -* ]] ; then
+ COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
+ return 0
+ else
+ COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
+ return 0
+ fi
+}
+complete -F _rebar rebar
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh