mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
15629: unzip -Z should behave just as zipinfo does
This commit is contained in:
parent
be5e65d2bb
commit
fcf0d2c3d5
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2001-08-14 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
|
* 15629: Completion/Unix/Command/_zip: unzip -Z
|
||||||
|
should behave the same as zipinfo.
|
||||||
|
|
||||||
2001-08-13 Bart Schaefer <schaefer@brasslantern.com>
|
2001-08-13 Bart Schaefer <schaefer@brasslantern.com>
|
||||||
|
|
||||||
* 15613 (plus unposted additions): Test/B02typeset.ztst: Tests for
|
* 15613 (plus unposted additions): Test/B02typeset.ztst: Tests for
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef zip unzip zipinfo
|
#compdef zip unzip zipinfo
|
||||||
|
|
||||||
local suffixes suf zipfile izip
|
local suffixes suf zipfile izip uzi
|
||||||
local expl curcontext="$curcontext" state line
|
local expl curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
@ -73,11 +73,17 @@ case $service in
|
||||||
'(-p -z)-L[lowercase (some) filenames]' \
|
'(-p -z)-L[lowercase (some) filenames]' \
|
||||||
'-M[page output]' \
|
'-M[page output]' \
|
||||||
'-x[exclude the following names]' \
|
'-x[exclude the following names]' \
|
||||||
|
'-Z[zipinfo mode]:zipinfomode:->zipinfo' \
|
||||||
"(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
|
"(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
|
||||||
'*:file:->files' && return 0
|
'*:file:->files' && return 0
|
||||||
;;
|
;;
|
||||||
zipinfo)
|
esac
|
||||||
|
|
||||||
|
[[ $state == zipinfo ]] && uzi="-Z[zipinfo mode]"
|
||||||
|
|
||||||
|
if [[ $service == zipinfo ]] || [[ -n $uzi ]]; then
|
||||||
_arguments -C -s \
|
_arguments -C -s \
|
||||||
|
$uzi \
|
||||||
'(-2 -s -m -l -v -h -t -T -z)-1[filenames only]' \
|
'(-2 -s -m -l -v -h -t -T -z)-1[filenames only]' \
|
||||||
'(-1 -s -m -l -v -T)-2[just filenames but allow -h/-t/-z]' \
|
'(-1 -s -m -l -v -T)-2[just filenames but allow -h/-t/-z]' \
|
||||||
'(-1 -2 -m -l -v -h -t)-s[short format]' \
|
'(-1 -2 -m -l -v -h -t)-s[short format]' \
|
||||||
|
@ -93,8 +99,7 @@ case $service in
|
||||||
'-x[exclude the following names]' \
|
'-x[exclude the following names]' \
|
||||||
"(-1 -2 -s -m -l -v -h -z -C -t -T -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
|
"(-1 -2 -s -m -l -v -h -z -C -t -T -M)1:zip file:_files -g '(#i)*.(zip|[jw]ar)'" \
|
||||||
'*:file:->files' && return 0
|
'*:file:->files' && return 0
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
suffixes)
|
suffixes)
|
||||||
|
|
Loading…
Reference in a new issue