From: Silvio Rhatto Date: Fri, 27 Sep 2013 22:20:08 +0000 (-0300) Subject: Support git completion found also at /usr/share X-Git-Tag: 0.2.6~22 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=de41af4df36193fb9df4b211243dc07b98156807;p=keyringer.git Support git completion found also at /usr/share --- diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index 3d519c9..936e5e0 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -9,9 +9,17 @@ fi # Completion for git subcommand _keyringer_git_complete() { + local git_completion="" + if [ -e "/etc/bash_completion.d/git" ]; then + git_completion="/etc/bash_completion.d/git" + elif [ -e "/usr/share/bash-completion/completions/git" ]; then + git_completion="/usr/share/bash-completion/completions/git" + fi + + if [ ! -z "$git_completion" ]; then ( - source /etc/bash_completion.d/git + source $git_completion cd $path COMP_WORDS=(git $*) COMP_CWORD=$((${#COMP_WORDS[*]} - 1))