[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-103-gae34153

Ville Skyttä ville.skytta at iki.fi
Mon Dec 19 22:37:22 UTC 2011


The following commit has been merged in the master branch:
commit ae34153c85c4567b3aabe5d5ddb0635c323db864
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Dec 20 00:36:39 2011 +0200

    cc, c++: Install gcc completion if compiler looks like GCC (Alioth: #311408).

diff --git a/completions/gcc b/completions/gcc
index bafb81b..48ee8e4 100644
--- a/completions/gcc
+++ b/completions/gcc
@@ -46,9 +46,10 @@ _gcc()
         _filedir
     fi
 } &&
-complete -F _gcc gcc g++ c++ g77 gcj gpc
-
-[[ $OSTYPE == *cygwin* ]] || _userland GNU && _have gcc && \
-    complete -F _gcc cc || :
+complete -F _gcc gcc g++ g77 gcj gpc &&
+{
+    cc  --version 2>/dev/null | grep -q GCC && complete -F _gcc cc  || :
+    c++ --version 2>/dev/null | grep -q GCC && complete -F _gcc c++ || :
+}
 
 # ex: ts=4 sw=4 et filetype=sh

-- 
bash-completion



More information about the Bash-completion-commits mailing list