aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-09 00:31:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-09 00:31:12 +1200
commitb7916dd271192464ebb101685917ec4139b78857 (patch)
tree643e93d65b77036e960620547fe56cb2bff72b90 /bash
parentAdd IFS clearing before filename/branch reads (diff)
downloaddotfiles-b7916dd271192464ebb101685917ec4139b78857.tar.gz
dotfiles-b7916dd271192464ebb101685917ec4139b78857.zip
Add completion for git-remote
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/git.bash26
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