diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
commit | 5732da2af736c40cf693354485446ab4867ecb4d (patch) | |
tree | 76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/gcc | |
parent | 9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff) | |
download | bash-completion-upstream/2.9.tar.gz |
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/gcc')
-rw-r--r-- | completions/gcc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/completions/gcc b/completions/gcc index b93a33f2..b72bf972 100644 --- a/completions/gcc +++ b/completions/gcc @@ -34,31 +34,33 @@ _gcc() esac if [[ "$cur" == -* ]]; then - cc=$( $1 -print-prog-name=$backend 2>/dev/null ) + cc=$($1 -print-prog-name=$backend 2>/dev/null) [[ $cc ]] || return # sink stderr: # for C/C++/ObjectiveC it's useless # for FORTRAN/Java it's an error - COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | tr '\t' ' ' |\ - command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir fi } && -complete -F _gcc gcc g++ gfortran g77 g95 gcj gpc && +complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ + gccgo{,-5,-6,-7,-8} gcj gfortran{,-5,-6,-7,-8} gpc && { cc --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand cc ) == *gcc* ]] && \ + [[ $(_realcommand cc) == *gcc* ]] && \ complete -F _gcc cc || complete -F _minimal cc c++ --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand c++ ) == *g++* ]] && \ + [[ $(_realcommand c++) == *g++* ]] && \ complete -F _gcc c++ || complete -F _minimal c++ f77 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f77 ) == *gfortran* ]] && \ + [[ $(_realcommand f77) == *gfortran* ]] && \ complete -F _gcc f77 || complete -F _minimal f77 f95 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f95 ) == *gfortran* ]] && \ + [[ $(_realcommand f95) == *gfortran* ]] && \ complete -F _gcc f95 || complete -F _minimal f95 } |