2010-01-08 22:47:41 +00:00
|
|
|
# bash completion for rebar
|
|
|
|
|
|
|
|
_rebar()
|
|
|
|
{
|
|
|
|
local cur prev opts
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
sopts="-h -v -f -j"
|
2010-01-09 12:31:31 +00:00
|
|
|
lopts=" --help --verbose --force --jobs"
|
2010-01-08 22:47:41 +00:00
|
|
|
cmdsnvars="analyze build_plt clean compile create-app \
|
|
|
|
create-app create-node eunit generate \
|
|
|
|
int_test perf_test test \
|
2010-01-08 23:43:22 +00:00
|
|
|
case= force=1 jobs= suite= verbose=1"
|
2010-01-08 22:47:41 +00:00
|
|
|
|
|
|
|
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
|