From 91ce2fcb83eb2f3d77199c017414edf83e9e303e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 10 Sep 2016 10:33:52 +1200 Subject: Add git-stash/submodule completion --- bash/bash_completion.d/git.bash | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'bash') 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 -- cgit v1.2.3