From e60a6acc41bd9a287c1ca593d5336a2cf03fef26 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 9 Jan 2010 13:35:09 +0100 Subject: Removed redundant create-app --- priv/shell-completion/bash/rebar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 36213ed..4a38f04 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -8,7 +8,7 @@ _rebar() prev="${COMP_WORDS[COMP_CWORD-1]}" sopts="-h -v -f -j" lopts=" --help --verbose --force --jobs" - cmdsnvars="analyze build_plt clean compile create-app \ + cmdsnvars="analyze build_plt clean compile \ create-app create-node eunit generate \ int_test perf_test test \ case= force=1 jobs= suite= verbose=1" -- cgit v1.1 From 51b3feabc4e98ab8e94d4639826e41fcd6138933 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 9 Jan 2010 14:50:29 +0100 Subject: Added check_plt to bash-completion --- priv/shell-completion/bash/rebar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 4a38f04..42edb51 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -8,7 +8,7 @@ _rebar() prev="${COMP_WORDS[COMP_CWORD-1]}" sopts="-h -v -f -j" lopts=" --help --verbose --force --jobs" - cmdsnvars="analyze build_plt clean compile \ + 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" -- cgit v1.1 From 59bfc5044f4dd7b826899a8caae0a3ee4168c0f5 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 9 Jan 2010 18:24:08 +0100 Subject: Fixed trailing space issue for options ending with an equal sign --- priv/shell-completion/bash/rebar | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 42edb51..f57ac0e 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -2,29 +2,45 @@ _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" + 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" + 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}) ) + 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 } -complete -F _rebar rebar +complete -o nospace -F _rebar rebar # Local variables: # mode: shell-script -- cgit v1.1 From ba306ec183b75113f13a9427434052367f73afb6 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 10 Jan 2010 10:38:05 +0100 Subject: Simplified bash-completion script --- priv/shell-completion/bash/rebar | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'priv') 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 -- cgit v1.1