mirror of
https://github.com/correl/rebar.git
synced 2024-11-27 11:09:55 +00:00
Added first version of a bash-completion script
This commit is contained in:
parent
4ac1f3efe9
commit
81fd519100
1 changed files with 36 additions and 0 deletions
36
priv/shell-completion/bash/rebar
Normal file
36
priv/shell-completion/bash/rebar
Normal file
|
@ -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
|
Loading…
Reference in a new issue