[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 35ac650e306fab403dad34171e953f08874a4fa7

Ville Skyttä ville.skytta at iki.fi
Tue Sep 28 16:19:02 UTC 2010


The following commit has been merged in the master branch:
commit 35ac650e306fab403dad34171e953f08874a4fa7
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Sep 28 19:14:08 2010 +0300

    Make mplayer -skin completion work with post-2006 versions.
    
    The subdir was "Skin" until 1.0pre8 (Jun 2006), "skins" in and after it.

diff --git a/completions/mplayer b/completions/mplayer
index f82d1c4..5d1b87c 100644
--- a/completions/mplayer
+++ b/completions/mplayer
@@ -11,7 +11,7 @@ _mplayer_options_list()
 
 _mplayer()
 {
-    local cmd cur prev skinsdir i j k=0
+    local cmd cur prev i j k=0
 
     COMPREPLY=()
     cmd=${COMP_WORDS[0]}
@@ -69,14 +69,15 @@ _mplayer()
         -skin)
             # if you don't have installed mplayer in /usr you
             # may want to set the MPLAYER_SKINS_DIR global variable
+            local -a dirs
             if [ -n "$MPLAYER_SKINS_DIR" ]; then
-                skinsdir=$MPLAYER_SKINS_DIR
+                dirs=($MPLAYER_SKINS_DIR)
             else
-                skinsdir=/usr/share/mplayer/Skin
+                dirs=(/usr/share/mplayer/skins /usr/local/share/mplayer/skins)
             fi
 
             local IFS=$'\t\n'
-            for i in ~/.mplayer/Skin $skinsdir; do
+            for i in ~/.mplayer/skins ${dirs[@]}; do
                 if [[ -d $i && -r $i ]]; then
                     for j in $( compgen -d $i/$cur ); do
                         COMPREPLY[$k]=${j#$i/}

-- 
bash-completion



More information about the Bash-completion-commits mailing list