From 02332d78f38d9baef7374841d736331dc5eaff09 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Fri, 5 Oct 2012 04:28:25 +0200 Subject: [PATCH] Added bash support for completion of full command line --- completions/rbenv.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/completions/rbenv.bash b/completions/rbenv.bash index e3276016..fe0784ac 100644 --- a/completions/rbenv.bash +++ b/completions/rbenv.bash @@ -5,8 +5,10 @@ _rbenv() { if [ "$COMP_CWORD" -eq 1 ]; then COMPREPLY=( $(compgen -W "$(rbenv commands)" -- "$word") ) else - local command="${COMP_WORDS[1]}" - local completions="$(rbenv completions "$command")" + local words=("${COMP_WORDS[@]}") + unset words[0] + unset words[$COMP_CWORD] + local completions=$(rbenv completions "${words[@]}") COMPREPLY=( $(compgen -W "$completions" -- "$word") ) fi }