bash-completion/bash-completion-lzop
Ville Skyttä ea0d49473c - 20080705; new upstream at http://bash-completion.alioth.debian.org/
- Perl, Debian, and scp patches applied upstream.
- Patch to improve man completion: more sections, better filename handling.
- Patch to speed up yum install/deplist completion (#478784).
- Patch to fix and speed up rpm installed packages completion.
- Update mock completion.
2009-01-06 18:44:43 +00:00

44 lines
1.2 KiB
Bash

# bash completion for lzop(1) -*- sh -*-
#
have lzop &&
_lzop()
{
local cur prev xspec IFS=$' \t\n'
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-d -x -l -I -t -V -h -L -q -v -c \
-o -p -f -n -N -P -S -U -1 -2 -3 -4 -5 -6 -7 -8 -9 \
--fast --best --decompress --uncompress --extract \
--test --list --ls --info --sysinfo --license --help \
--version --stdout --output --path --force --no-name \
--no-checksum --name --no-mode --no-time --suffix \
--keep --unlink --delete --crc32 --no-warn --quiet \
--silent --ignore-warn --verbose --no-stdin --filter \
--checksum --no-color --mono --color' -- $cur ) )
return 0
fi
xspec="*.?(t)lzo"
if [[ "$prev" == --* ]]; then
[[ "$prev" == --@(de|un)compress || \
"$prev" == --list || \
"$prev" == --test ]] && xspec="!"$xspec
[[ "$prev" == --force ]] && xspec=
elif [[ "$prev" == -* ]]; then
[[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec
[[ "$prev" == -*f* ]] && xspec=
elif [ "$prev" = '>' ]; then
xspec=
fi
_expand || return 0
COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
$( compgen -d -- $cur ) )
} &&
complete -F _lzop $filenames lzop