diff options
Diffstat (limited to 'completions/lzop')
-rw-r--r-- | completions/lzop | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/completions/lzop b/completions/lzop index 6d384128..a5084bb0 100644 --- a/completions/lzop +++ b/completions/lzop @@ -1,23 +1,9 @@ -# lzop(1) completion +# lzop(1) completion -*- shell-script -*- -have lzop && _lzop() { - local cur prev xspec - - COMPREPLY=() - _get_comp_words_by_ref cur prev - - 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 cur prev words cword + _init_completion || return case $prev in -o|--output) @@ -33,7 +19,18 @@ _lzop() ;; esac - xspec="*.?(t)lzo" + 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) xspec="!"$xspec @@ -43,7 +40,7 @@ _lzop() ;; --*) ;; - -*f*|'<'|'>') + -*f*) xspec= ;; -*[dltx]*) @@ -54,16 +51,10 @@ _lzop() _expand || return 0 local IFS=$'\n' - _compopt_o_filenames + compopt -o filenames COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && complete -F _lzop lzop -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: # ex: ts=4 sw=4 et filetype=sh |