about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-08-14 16:23:41 +0000
committerClint Adams <clint@users.sourceforge.net>2001-08-14 16:23:41 +0000
commitfcf0d2c3d5c5591db0772e0718bae1159e99c11b (patch)
treeaf6dfc030765631019e45483f5edd3ec0f2b1b3c /Completion
parentbe5e65d2bbc04b66655c88cbf0f9075f50c310c2 (diff)
downloadzsh-fcf0d2c3d5c5591db0772e0718bae1159e99c11b.tar.gz
zsh-fcf0d2c3d5c5591db0772e0718bae1159e99c11b.tar.xz
zsh-fcf0d2c3d5c5591db0772e0718bae1159e99c11b.zip
15629: unzip -Z should behave just as zipinfo does
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_zip13
1 files changed, 9 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip
index b01b756af..b8117c7b4 100644
--- a/Completion/Unix/Command/_zip
+++ b/Completion/Unix/Command/_zip
@@ -1,6 +1,6 @@
 #compdef zip unzip zipinfo
 
-local suffixes suf zipfile izip
+local suffixes suf zipfile izip uzi
 local expl curcontext="$curcontext" state line
 typeset -A opt_args
 
@@ -73,11 +73,17 @@ case $service in
       '(-p -z)-L[lowercase (some) filenames]' \
       '-M[page output]' \
       '-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)'" \
       '*:file:->files' && return 0
   ;;
-  zipinfo)
+esac
+
+[[ $state == zipinfo ]] && uzi="-Z[zipinfo mode]"
+
+if [[ $service == zipinfo ]] || [[ -n $uzi ]]; then
     _arguments -C -s \
+      $uzi \
       '(-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 -2 -m -l -v -h -t)-s[short format]' \
@@ -93,8 +99,7 @@ case $service in
       '-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)'" \
       '*:file:->files' && return 0
-  ;;
-esac
+fi
 
 case $state in
   suffixes)