Use compgen -W in _longopt().

This commit is contained in:
Ville Skyttä 2009-05-10 20:27:33 +03:00
parent 3e016e4679
commit a679544447

View File

@ -4275,9 +4275,9 @@ _longopt()
fi
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( $1 --help 2>&1 | sed -e '/--/!d' \
-e 's/.*\(--[-A-Za-z0-9]\+\).*/\1/' | \
command grep "^$cur" | sort -u ) )
COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | sed -e '/--/!d' \
-e 's/.*\(--[-A-Za-z0-9]\+\).*/\1/' |sort -u )"\
-- $cur ) )
elif [[ "$1" == rmdir ]]; then
_filedir -d
else