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