diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2010-01-10 10:38:05 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2010-01-10 10:38:05 +0100 |
commit | ba306ec183b75113f13a9427434052367f73afb6 (patch) | |
tree | 6d95f6068df24c6f2db7290a81f3010f0b9f9ccd /priv/shell-completion | |
parent | 59bfc5044f4dd7b826899a8caae0a3ee4168c0f5 (diff) |
Simplified bash-completion script
Diffstat (limited to 'priv/shell-completion')
-rw-r--r-- | priv/shell-completion/bash/rebar | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index f57ac0e..a974915 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -15,30 +15,19 @@ _rebar() if [[ ${cur} == --* ]] ; then COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) ) - if [ -n "$COMPREPLY" ] ; then - # append space if matched - COMPREPLY="${COMPREPLY} " - # remove trailing space if --lopt=value option - COMPREPLY=${COMPREPLY/%= /=} - fi - return 0 elif [[ ${cur} == -* ]] ; then COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) ) - if [ -n "$COMPREPLY" ] ; then - # append space if matched - COMPREPLY="${COMPREPLY} " - fi - return 0 else COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) ) - if [ -n "$COMPREPLY" ] ; then - # append space if matched - COMPREPLY="${COMPREPLY} " - # remove trailing space if var= option - COMPREPLY=${COMPREPLY/%= /=} - fi - 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 -o nospace -F _rebar rebar |