[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 38516ee43194fd496971a9c37e23109f3816e4bf

Guillaume Rousse guillaume at oberkampf.msr-inria.inria.fr
Thu Dec 31 16:36:41 UTC 2009


The following commit has been merged in the master branch:
commit 877d36fefb775b88e359ebfad4db46400c90e2bd
Author: Guillaume Rousse <guillaume at oberkampf.msr-inria.inria.fr>
Date:   Wed Dec 30 00:31:17 2009 +0100

    make selection of optionsvs mandatory argument completion similar to others

diff --git a/contrib/unace b/contrib/unace
index 9db7bd5..7d065c0 100644
--- a/contrib/unace
+++ b/contrib/unace
@@ -8,22 +8,16 @@ _unace()
     COMPREPLY=()
     cur=`_get_cword`
 
-    case "$cur" in
-        -*)
-            COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' \
-                -- "$cur" ) )
-            ;;
-        *)
+
+    if [[ "$cur" == -* ]] ; then
+        COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur" ) )
+    else
         if [ $COMP_CWORD -eq 1 ]; then
             COMPREPLY=( $( compgen -W 'e l t v x' -- "$cur" ) )
         else
             _filedir '@(ace|ACE)'
         fi
-        ;;
-    esac
-
-    return 0
-
+    fi
 } &&
 complete -F _unace -o filenames unace
 
diff --git a/contrib/unrar b/contrib/unrar
index eecc843..278b6a7 100644
--- a/contrib/unrar
+++ b/contrib/unrar
@@ -8,22 +8,18 @@ _unrar()
     COMPREPLY=()
     cur=`_get_cword`
 
-    case "$cur" in
-        -*)
+    if [[ "$cur" == -* ]] ; then
         COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \
             -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \
             -tb -tn -to -u -v -ver -vp -x -x@ -y' -- "$cur" ) )
-        ;;
-        *)
+    else
         if [ $COMP_CWORD -eq 1 ]; then
             COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) )
         else
             _filedir '@(rar|RAR)'
         fi
-        ;;
-    esac
+    fi
 
-    return 0
 } &&
 complete -F _unrar -o filenames unrar
 
diff --git a/contrib/yum-arch b/contrib/yum-arch
index f28a9da..fe70e77 100644
--- a/contrib/yum-arch
+++ b/contrib/yum-arch
@@ -7,17 +7,11 @@ _yum_arch()
     COMPREPLY=()
     cur=`_get_cword`
 
-    case "$cur" in
-        -*)
-            COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l \
-                -q' -- "$cur" ) )
-            ;;
-        *)
-            _filedir -d
-            ;;
-    esac
-
-    return 0
+    if [[ "$cur" == -* ]] ; then
+        COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur" ) )
+    else
+        _filedir -d
+    fi
 } &&
 complete -F _yum_arch -o filenames yum-arch
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list