Skip to content

Commit

Permalink
Append all arguments to --complete
Browse files Browse the repository at this point in the history
Fixes qrush#7
(if using bash)

When bash-completion is invoked, all arguments are now
forwarded to the command, e.g.

sub command arg1 arg2 <tab>

now triggers:

sub --complete command arg1 arg2

instead of just:

sub --complete command
  • Loading branch information
Francesco Negri committed Jan 16, 2013
1 parent bb93f15 commit e5017ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions completions/sub.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ _sub() {
if [ "$COMP_CWORD" -eq 1 ]; then
COMPREPLY=( $(compgen -W "$(sub commands)" -- "$word") )
else
local command="${COMP_WORDS[1]}"
local completions="$(sub completions "$command")"
local command="${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}"
local completions="$(sub completions $command)"
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi
}
Expand Down

0 comments on commit e5017ed

Please sign in to comment.