mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 21:44:11 +01:00
moved from Completion/User/_bzip2
This commit is contained in:
parent
956c1f2b08
commit
10a29645fc
59
Completion/Unix/Command/_bzip2
Normal file
59
Completion/Unix/Command/_bzip2
Normal file
@ -0,0 +1,59 @@
|
||||
#compdef bzip2 bunzip2 bzcat=bunzip2 bzip2recover
|
||||
|
||||
local decompress expl state line curcontext="$curcontext"
|
||||
typeset -A opt_args
|
||||
|
||||
case "$service" in
|
||||
bzip2recover) [[ $CURRENT = 2 ]] && state=files;;
|
||||
bzip2) decompress=no;&
|
||||
bunzip2) _arguments -C -s -S \
|
||||
'(--help)-h[display help message]' \
|
||||
'(-h)--help[display help message]' \
|
||||
'(--decompress --compress -z --test -t)-d[decompress]' \
|
||||
'(-d --compress -z --test -t)--decompress[decompress]' \
|
||||
'(--compress --decompress -d --test -t)-z[compress]' \
|
||||
'(-z --decompress -d --test -t)--compress[compress]' \
|
||||
"(--keep)-k[keep (don't delete) input files]" \
|
||||
"(-k)--keep[keep (don't delete) input files]" \
|
||||
'(--force)-f[force overwrite]' \
|
||||
'(-f)--force[force overwrite]' \
|
||||
'(--test --decompress -d --compress -z )-t[test compressed file integrity]' \
|
||||
'(-t --decompress -d --compress -z )--test[test compressed file integrity]' \
|
||||
'(--stdout)-c[write on standard output]' \
|
||||
'(-c)--stdout[write on standard output]' \
|
||||
'(--quiet)-q[suppress all warnings]' \
|
||||
'(-q)--quiet[suppress all warnings]' \
|
||||
'*-v[verbose mode]' \
|
||||
'*--verbose[verbose mode]' \
|
||||
'(--license)-L[display software license]' \
|
||||
'(-L)--license[display software license]' \
|
||||
'(--version)-V[display version number]' \
|
||||
'(-V)--version[display version number]' \
|
||||
'(--small)-s[use less memory (at most 2500k)]' \
|
||||
'( -2 -3 -4 -5 -6 -7 -8 -9)-1' \
|
||||
'(-1 -3 -4 -5 -6 -7 -8 -9)-2' \
|
||||
'(-1 -2 -4 -5 -6 -7 -8 -9)-3' \
|
||||
'(-1 -2 -3 -5 -6 -7 -8 -9)-4' \
|
||||
'(-1 -2 -3 -4 -6 -7 -8 -9)-5' \
|
||||
'(-1 -2 -3 -4 -5 -7 -8 -9)-6' \
|
||||
'(-1 -2 -3 -4 -5 -6 -8 -9)-7' \
|
||||
'(-1 -2 -3 -4 -5 -6 -7 -9)-8' \
|
||||
'(-1 -2 -3 -4 -5 -6 -7 -8 )-9' \
|
||||
'*:files:->files' && return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$state" = files ]]; then
|
||||
(( $+opt_args[-z] || $+opt_args[--compress] )) && decompress=no
|
||||
(( $+opt_args[-d] || $+opt_args[--decompress] || $+opt_args[-t] ||
|
||||
$+opt_args[--test] )) && unset decompress
|
||||
if [[ -z "$decompress" ]]; then
|
||||
_description files expl 'compressed file'
|
||||
_files "$expl[@]" -g '*.bz2' && return 0
|
||||
else
|
||||
_description files expl 'file to compress'
|
||||
_files "$expl[@]" -g '*~*.bz2' && return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
return 1
|
Loading…
Reference in New Issue
Block a user