[Bash-completion-devel] Bug#721935: Bash completion for cc and c++ does not work

Sebastian Ramacher sramacher at debian.org
Thu Sep 5 16:58:09 UTC 2013


Control: reassign -1 bash-completion 1:2.0-1

On 2013-09-05 16:50:53, Andrea Corbellini wrote:
> Package: bash-completionVersion: 1:2.0-1
> Typing "cc <TAB>" at the bash prompt does not give any hint.
> The problem lies in the following piece of
> /usr/share/bash-completion/completions/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++ || :}
> "cc/gcc/c++/g++ --version" do not print GCC, therefore the
> completion for cc/c++ is never installed.
> I suggest to use this check instead:
>  [[ "$(readlink -f /usr/bin/cc)" == "$(readlink -f /usr/bin/gcc)" ]]
> However a problem still remains: when cc is not GCC, there is no
> completion. Therefore
>  || :
> should be replaced with
>  || complete -F _minimal cc

-- 
Sebastian Ramacher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20130905/8b72692c/attachment.sig>


More information about the Bash-completion-devel mailing list