summaryrefslogtreecommitdiff
path: root/priv/shell-completion/bash/rebar3
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-04-03 15:01:20 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-04-03 15:01:20 -0400
commit9753617471e560dbf45b3dd1f2475155a10006a8 (patch)
tree296afbe7b5b5aa5015392cab2f0bedfa5fff7d69 /priv/shell-completion/bash/rebar3
parentf51ac0ba8ec126750e46b01a3993b00e3776a36f (diff)
parent0ceb3bd6ce302af9a1997a01a3ec6e5408ada364 (diff)
Merge pull request #304 from ingwinlu/fix_shell_completions
impl shell completion
Diffstat (limited to 'priv/shell-completion/bash/rebar3')
-rw-r--r--priv/shell-completion/bash/rebar3172
1 files changed, 172 insertions, 0 deletions
diff --git a/priv/shell-completion/bash/rebar3 b/priv/shell-completion/bash/rebar3
new file mode 100644
index 0000000..758deee
--- /dev/null
+++ b/priv/shell-completion/bash/rebar3
@@ -0,0 +1,172 @@
+# bash completion for rebar3
+
+_rebar3()
+{
+ local cur prev sopts lopts cmdsnvars
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ if [[ ${prev} == rebar3 ]] ; then
+ sopts="-h -v"
+ lopts="--help --version"
+ cmdsnvars="as \
+ clean \
+ compile \
+ cover \
+ ct \
+ dialyzer \
+ do \
+ edoc \
+ escriptize \
+ eunit \
+ help \
+ new \
+ pkgs \
+ release \
+ shell \
+ tar \
+ update \
+ upgrade \
+ version \
+ wtf \
+ xref"
+ elif [[ ${prev} == as ]] ; then
+ :
+ elif [[ ${prev} == clean ]] ; then
+ sopts="-a"
+ lopts="--all"
+ elif [[ ${prev} == compile ]] ; then
+ :
+ elif [[ ${prev} == cover ]] ; then
+ sopts="-r -v"
+ lopts="--reset --verbose"
+ elif [[ ${prev} == ct ]] ; then
+ sopts="-c -v"
+ lopts="--dir \
+ --suite \
+ --group \
+ --case \
+ --spec \
+ --join_specs \
+ --label \
+ --config \
+ --userconfig \
+ --allow_user_terms \
+ --logdir \
+ --logopts \
+ --verbosity \
+ --silent_connections \
+ --stylesheet \
+ --cover \
+ --cover_spec \
+ --cover_stop \
+ --event_handler \
+ --include \
+ --abort_if_missing_suites \
+ --multiply_timetraps \
+ --scale_timetraps \
+ --create_priv_dir \
+ --repeat \
+ --duration \
+ --until \
+ --force_stop \
+ --basic_html \
+ --ct_hooks \
+ --verbose"
+ elif [[ ${prev} == dialyzer ]] ; then
+ sopts="-u -s"
+ lopts="--update-plt --succ-typings"
+ elif [[ ${prev} == do ]] ; then
+ :
+ elif [[ ${prev} == edoc ]] ; then
+ :
+ elif [[ ${prev} == escriptize ]] ; then
+ :
+ elif [[ ${prev} == eunit ]] ; then
+ sopts="-c -v"
+ lopts="--app --cover --suite --verbose"
+ elif [[ ${prev} == help ]] ; then
+ :
+ elif [[ ${prev} == new ]] ; then
+ sopts="-f"
+ lopts="--force"
+ elif [[ ${prev} == pkgs ]] ; then
+ :
+ elif [[ ${prev} == release ]] ; then
+ sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r"
+ lopts="--relname \
+ --relvsn \
+ --goal \
+ --upfrom \
+ --output-dir \
+ --help \
+ --lib-dir \
+ --path \
+ --default-libs \
+ --verbose \
+ --dev-mode \
+ --include-erts \
+ --override \
+ --config \
+ --overlay_vars \
+ --vm_args \
+ --sys_config \
+ --system_libs \
+ --version \
+ --root"
+ elif [[ ${prev} == shell ]] ; then
+ :
+ elif [[ ${prev} == tar ]] ; then
+ sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r"
+ lopts="--relname \
+ --relvsn \
+ --goal \
+ --upfrom \
+ --output-dir \
+ --help \
+ --lib-dir \
+ --path \
+ --default-libs \
+ --verbose \
+ --dev-mode \
+ --include-erts \
+ --override \
+ --config \
+ --overlay_vars \
+ --vm_args \
+ --sys_config \
+ --system_libs \
+ --version \
+ --root"
+ elif [[ ${prev} == update ]] ; then
+ :
+ elif [[ ${prev} == upgrade ]] ; then
+ :
+ elif [[ ${prev} == version ]] ; then
+ :
+ elif [[ ${prev} == wtf ]] ; then
+ :
+ elif [[ ${prev} == xref ]] ; then
+ :
+ fi
+
+ COMPREPLY=( $(compgen -W "${sopts} ${lopts} ${cmdsnvars}" -- ${cur}) )
+
+ if [ -n "$COMPREPLY" ] ; then
+ # append space if matched
+ COMPREPLY="${COMPREPLY} "
+ # remove trailing space after equal sign
+ COMPREPLY=${COMPREPLY/%= /=}
+ fi
+ return 0
+}
+complete -o nospace -F _rebar3 rebar3
+
+# 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