[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-261-g33900b8

Ville Skyttä ville.skytta at iki.fi
Tue May 3 09:42:53 UTC 2011


The following commit has been merged in the master branch:
commit 33900b872472b645b03773250bbebc8dbb8910a4
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue May 3 12:41:28 2011 +0300

    xzdec: Complete $cur == -* after option argument and split checks.

diff --git a/completions/xz b/completions/xz
index 80a70dd..68aad1c 100644
--- a/completions/xz
+++ b/completions/xz
@@ -61,12 +61,6 @@ _xzdec()
     local cur prev words cword split
     _init_completion -s || return
 
-    if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
-        [[ $COMPREPLY == *= ]] && compopt -o nospace
-        return 0
-    fi
-
     case $prev in
         -M|--memory)
             # argument required but no completions available
@@ -80,6 +74,12 @@ _xzdec()
 
     $split && return 0
 
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return 0
+    fi
+
     _filedir xz # no lzma support here as of xz 4.999.9beta
 } &&
 complete -F _xzdec xzdec

-- 
bash-completion



More information about the Bash-completion-commits mailing list