Use compgen -W in gcc completion.

This commit is contained in:
Ville Skyttä 2009-05-10 20:31:28 +03:00
parent a679544447
commit 147642d722

View File

@ -4340,9 +4340,10 @@ _gcc()
# sink stderr:
# for C/C++/ObjectiveC it's useless
# for FORTRAN/Java it's an error
COMPREPLY=( $( $cc --help 2>/dev/null | tr '\t' ' ' | \
COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | \
tr '\t' ' ' | \
sed -e '/^ *-/!d' -e 's/ *-\([^ ]*\).*/-\1/' | \
command grep "^$cur" | sort -u ) )
sort -u )" -- $cur ) )
else
_filedir
fi