Use compgen -W instead of grepping $cur.

This commit is contained in:
Ville Skyttä 2009-04-18 22:37:46 +03:00
parent 8a24a283a4
commit 2e66656e68

View File

@ -7,10 +7,9 @@ have mplayer && {
_mplayer_options_list()
{
cur=${cur%\\}
COMPREPLY=( $( $1 $2 help 2> /dev/null | \
COMPREPLY=( $( compgen -W "$( $1 $2 help 2>/dev/null | \
sed -e '1,/^Available/d' | awk '{print $1}' | \
sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' | \
grep "^$cur" ) )
sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' )" -- $cur ) )
}
_mplayer()