diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-09 00:31:12 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-09 00:31:12 +1200 |
commit | b7916dd271192464ebb101685917ec4139b78857 (patch) | |
tree | 643e93d65b77036e960620547fe56cb2bff72b90 /bash/bash_completion.d/git.bash | |
parent | Add IFS clearing before filename/branch reads (diff) | |
download | dotfiles-b7916dd271192464ebb101685917ec4139b78857.tar.gz dotfiles-b7916dd271192464ebb101685917ec4139b78857.zip |
Add completion for git-remote
Diffstat (limited to 'bash/bash_completion.d/git.bash')
-rw-r--r-- | bash/bash_completion.d/git.bash | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 8e10910b..34a6f5ef 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -52,6 +52,32 @@ _git() { 2>/dev/null) ;; + # Complete with remote subcommands and then remote names + remote) + local word + while IFS= read -r word ; do + [[ -n $word ]] || continue + COMPREPLY[${#COMPREPLY[@]}]=$word + done < <( + if ((COMP_CWORD - sci > 1)) ; then + git remote 2>/dev/null + else + compgen -W ' + add + get-url + prune + remove + rename + set-branches + set-head + set-url + show + update + ' -- "${COMP_WORDS[COMP_CWORD]}" + fi + ) + ;; + # Complete with ref names *) local ref |