mplayer: Add generic handling of options that take arguments.

This commit is contained in:
Ville Skyttä 2012-01-15 14:24:38 +02:00
parent a90d7d861a
commit 45c0886acc

View File

@ -243,6 +243,17 @@ _mplayer()
COMPREPLY=( $( compgen -W 'all gui system user' -- "$cur" ) )
return 0
;;
-*)
# Assume arg is required for everything else except options
# for which -list-options says Type is Flag or Print.
$cmd -nomsgcolor -nomsgmodule -list-options 2>/dev/null \
| while read -r i j k; do
if [[ $i == ${prev#-} ]]; then
[[ ${j,,} != @(flag|print) ]] && return 1
break
fi
done || return 0
;;
esac
case $cur in