[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-138-g45c0886

Ville Skyttä ville.skytta at iki.fi
Sun Jan 15 12:25:57 UTC 2012


The following commit has been merged in the master branch:
commit 45c0886accafd08272fa17c5daad85a1ee52cd56
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Jan 15 14:24:38 2012 +0200

    mplayer: Add generic handling of options that take arguments.

diff --git a/completions/mplayer b/completions/mplayer
index 85d11b0..ba8e3e9 100644
--- a/completions/mplayer
+++ b/completions/mplayer
@@ -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

-- 
bash-completion



More information about the Bash-completion-commits mailing list