rebar/priv/shell-completion/bash/rebar

42 lines
1.2 KiB
Text
Raw Normal View History

# bash completion for rebar
_rebar()
{
local cur prev sopts lopts cmdsnvars
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
sopts="-h -c -v -V -f -j"
lopts=" --help --commands --verbose --force --jobs= --version"
cmdsnvars="build-plt check-plt check-deps clean compile \
create create-app create-node ct dialyze doc delete-deps eunit \
get-deps generate generate-upgrade help list-templates update-deps \
version xref case= force=1 jobs= suite= verbose=1 appid= \
2011-04-06 16:57:37 +00:00
previous_release= skip_deps=1 skip_app= template= template_dir="
if [[ ${cur} == --* ]] ; then
COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
elif [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
else
COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
fi
2010-01-10 09:38:05 +00:00
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 _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