[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-354-g0a3029a

Ville Skyttä ville.skytta at iki.fi
Wed Jun 8 18:58:16 UTC 2011


The following commit has been merged in the master branch:
commit 0a3029ac4967fdcec473ae9558b50d3702870cf2
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Jun 8 21:57:54 2011 +0300

    lrzip, lzop, xz: Complete option arguments before options.

diff --git a/completions/lrzip b/completions/lrzip
index eb9d0f3..897f80e 100644
--- a/completions/lrzip
+++ b/completions/lrzip
@@ -7,11 +7,6 @@ _lrzip()
     local cur prev words cword
     _init_completion || return
 
-    if [[ "$cur" == -* && $prev != -N ]]; then
-        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
-        return 0
-    fi
-
     local xspec="*.lrz"
 
     case $prev in
@@ -45,6 +40,11 @@ _lrzip()
 
     _expand || return 0
 
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+        return 0
+    fi
+
     local IFS=$'\n'
     compopt -o filenames
     COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
diff --git a/completions/lzop b/completions/lzop
index a88ec46..97ca990 100644
--- a/completions/lzop
+++ b/completions/lzop
@@ -7,17 +7,6 @@ _lzop()
     local cur prev words cword
     _init_completion || return
 
-    if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \
-            --fast --best --decompress --extract --test --list --ls --info \
-            --sysinfo --license --help --version --stdout --output --path \
-            --force --no-checksum --no-name --name --no-mode --no-time \
-            --suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet \
-            --verbose --no-stdin --filter --checksum --no-color --mono \
-            --color' -- "$cur" ) )
-        return 0
-    fi
-
     case $prev in
         -o|--output)
             _filedir
@@ -32,6 +21,17 @@ _lzop()
             ;;
     esac
 
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \
+            --fast --best --decompress --extract --test --list --ls --info \
+            --sysinfo --license --help --version --stdout --output --path \
+            --force --no-checksum --no-name --name --no-mode --no-time \
+            --suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet \
+            --verbose --no-stdin --filter --checksum --no-color --mono \
+            --color' -- "$cur" ) )
+        return 0
+    fi
+
     local xspec="*.?(t)lzo"
     case $prev in
         --decompress|--uncompress|--extract|--list|--ls|--info|--test)
diff --git a/completions/xz b/completions/xz
index 68aad1c..3cf0527 100644
--- a/completions/xz
+++ b/completions/xz
@@ -6,13 +6,6 @@ _xz()
     local cur prev words cword split
     _init_completion -s || return
 
-    if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help ) {-1..-9}' \
-            -- "$cur" ) )
-        [[ $COMPREPLY == *= ]] && compopt -o nospace
-        return 0
-    fi
-
     local xspec="*.@(xz|lzma|txz|tlz)"
 
     case $prev in
@@ -46,6 +39,13 @@ _xz()
 
     _expand || return 0
 
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help ) {-1..-9}' \
+            -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return 0
+    fi
+
     local IFS=$'\n'
     compopt -o filenames
     COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \

-- 
bash-completion



More information about the Bash-completion-commits mailing list