Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Append all arguments to --complete #35

Open
wants to merge 1 commit into from

6 participants

@dhinus

Fixes #7
(if using bash)

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

sub command arg1 arg2

now triggers:

sub --complete command arg1 arg2

instead of just:

sub --complete command

Francesco Negri Append all arguments to --complete
Fixes #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
e5017ed
@sandrods

+1

@mgodwin

+1

@mppfiles

:+1: freakin' awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 16, 2013
  1. Append all arguments to --complete

    Francesco Negri authored
    Fixes #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
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 completions/sub.bash
View
4 completions/sub.bash
@@ -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
}
Something went wrong with that request. Please try again.