mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
42 lines
1.3 KiB
Bash
42 lines
1.3 KiB
Bash
# 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="check-deps clean compile create create-app create-node ct \
|
|
doc delete-deps escriptize eunit get-deps generate generate-upgrade \
|
|
help list-deps list-templates qc test-compile update-deps version \
|
|
xref overlay apps= case= force=1 jobs= suites= verbose=1 appid= \
|
|
previous_release= nodeid= root_dir= skip_deps=true skip_apps= \
|
|
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
|
|
|
|
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
|