]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Support git completion found also at /usr/share
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Sep 2013 22:20:08 +0000 (19:20 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Sep 2013 22:20:08 +0000 (19:20 -0300)
lib/keyringer/completions/bash/keyringer

index 3d519c999ae982293fdb98820d8e1a4333031950..936e5e0c6c4618f5011533e7704e892e47e31b72 100644 (file)
@@ -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))