diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-10 10:33:52 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-10 10:33:52 +1200 |
commit | 91ce2fcb83eb2f3d77199c017414edf83e9e303e (patch) | |
tree | 0419e3dc5b61b9e3909fb41b0ebd4521838b48f8 /bash/bash_completion.d | |
parent | Move a local declaration (diff) | |
download | dotfiles-91ce2fcb83eb2f3d77199c017414edf83e9e303e.tar.gz dotfiles-91ce2fcb83eb2f3d77199c017414edf83e9e303e.zip |
Add git-stash/submodule completion
Diffstat (limited to 'bash/bash_completion.d')
-rw-r--r-- | bash/bash_completion.d/git.bash | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 926cb151..5f4290b8 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -154,6 +154,48 @@ _git() { return ;; + # Complete with stash subcommands + stash) + ((COMP_CWORD == 2)) || return + local word + while IFS= read -r word ; do + [[ -n $word ]] || continue + COMPREPLY[${#COMPREPLY[@]}]=$word + done < <(compgen -W ' + apply + branch + clear + create + drop + list + pop + save + show + store + ' -- "${COMP_WORDS[COMP_CWORD]}") + return + ;; + + # Complete with submodule subcommands + submodule) + ((COMP_CWORD == 2)) || return + local word + while IFS= read -r word ; do + [[ -n $word ]] || continue + COMPREPLY[${#COMPREPLY[@]}]=$word + done < <(compgen -W ' + add + deinit + foreach + init + status + summary + sync + update + ' -- "${COMP_WORDS[COMP_CWORD]}") + return + ;; + # Complete with remotes and then refs fetch|pull|push) if ((COMP_CWORD == 2)) ; then |