diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2010-01-10 06:48:08 -0700 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-01-10 06:48:08 -0700 |
commit | abeac053e0a4656017f414b0a6417b7a8f163285 (patch) | |
tree | 5ea2fd0ea3eaab2645fe4292f93b09851a7fcee2 /priv/shell-completion/bash | |
parent | c6a0d44afae34c873a9fd5d26736613a561af1c9 (diff) | |
parent | ba306ec183b75113f13a9427434052367f73afb6 (diff) |
Merge mainline
Diffstat (limited to 'priv/shell-completion/bash')
-rw-r--r-- | priv/shell-completion/bash/rebar | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 36213ed..a974915 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -2,29 +2,34 @@ _rebar() { - local cur prev opts + local cur prev sopts lopts cmdsnvars 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 jobs= suite= verbose=1" + lopts=" --help --verbose --force --jobs=" + cmdsnvars="analyze build_plt check_plt clean compile \ + create-app create-node eunit generate \ + int_test perf_test test \ + case= force=1 jobs= 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 + + if [ -n "$COMPREPLY" ] ; then + # append space if matched + COMPREPLY="${COMPREPLY} " + # remove trailing space after equal sign + COMPREPLY=${COMPREPLY/%= /=} + fi + return 0 } -complete -F _rebar rebar +complete -o nospace -F _rebar rebar # Local variables: # mode: shell-script |