zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: unzip -Z
@ 2001-08-14 16:22 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2001-08-14 16:22 UTC (permalink / raw)
  To: zsh-workers

unzip -Z should behave just as zipinfo does.
Will commit to both branches.

Index: Completion/Unix/Command/_zip
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_zip,v
retrieving revision 1.1
diff -u -r1.1 _zip
--- Completion/Unix/Command/_zip	2001/04/02 12:07:44	1.1
+++ Completion/Unix/Command/_zip	2001/08/14 16:20:24
@@ -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 @@
       '(-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 @@
       '-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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-14 16:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-14 16:22 PATCH: unzip -Z Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).