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

This commit is contained in:
Ville Skyttä 2011-06-08 21:57:54 +03:00
parent c28c06baef
commit 0a3029ac49
3 changed files with 23 additions and 23 deletions

View File

@ -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" ) \

View File

@ -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)

View File

@ -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" ) \