diff --git a/completions/lrzip b/completions/lrzip index eb9d0f3b..897f80e3 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 a88ec461..97ca9901 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 68aad1cf..3cf05271 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" ) \