From 81fd5191005bf7575e64737d61a6559e6342a838 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 8 Jan 2010 23:47:41 +0100 Subject: Added first version of a bash-completion script --- priv/shell-completion/bash/rebar | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 priv/shell-completion/bash/rebar (limited to 'priv/shell-completion') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar new file mode 100644 index 0000000..33997b8 --- /dev/null +++ b/priv/shell-completion/bash/rebar @@ -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 -- cgit v1.1 From 2ae3fd9aae47efb40acdb1a9912c547b3cba2b06 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 9 Jan 2010 00:43:22 +0100 Subject: Added jobs= to bash-completion --- priv/shell-completion/bash/rebar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv/shell-completion') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 33997b8..045efb9 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -12,7 +12,7 @@ _rebar() 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" + case= force=1 jobs= suite= verbose=1" if [[ ${cur} == --* ]] ; then COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) ) -- cgit v1.1 From 1e6d92a3a64036982368c23a592a9a49046adb04 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 9 Jan 2010 13:31:31 +0100 Subject: Fixed bash-completion to use --jobs without equal sign and removed comment --- priv/shell-completion/bash/rebar | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'priv/shell-completion') diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar index 045efb9..36213ed 100644 --- a/priv/shell-completion/bash/rebar +++ b/priv/shell-completion/bash/rebar @@ -1,6 +1,5 @@ # bash completion for rebar -#have rebar && _rebar() { local cur prev opts @@ -8,7 +7,7 @@ _rebar() 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 clean compile create-app \ create-app create-node eunit generate \ int_test perf_test test \ -- cgit v1.1