Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _zmv



The yodl documentation for zmv doesn't mention the -W option so this
patch adds that and a completion for it.

Oliver

Index: Completion/Zsh/Command/_zmv
===================================================================
RCS file: Completion/Zsh/Command/_zmv
diff -N Completion/Zsh/Command/_zmv
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Zsh/Command/_zmv	7 Jan 2003 15:45:33 -0000
@@ -0,0 +1,21 @@
+#compdef zmv zln zcp
+
+_arguments -s -S -A '-*' \
+  '(-C -L -s -p)-M[force mv]' \
+  '(-M -L -s -p)-C[force cp]' \
+  '(-M -C -p)-L[force ln]' \
+  '-f[force overwriting of destination files]' \
+  '-i[interactive: prompt for each operation]' \
+  '-n[no execution: just print what would happen]' \
+  '-Q[force bare glob qualifiers on]' \
+  '(-C -M)-s[symbolic, passed down to ln]' \
+  '-v[verbose: print line as it is executed]' \
+  '-o[specify options to pass to underlying command]: opt string' \
+  '(-M -C -L -s)-p+[specify program to run instead of cp, ln or mv]:program:_command_names -e' \
+  '(-W)-w[implicitly add parenthesis to wildcards in the pattern]' \
+  '(-w)-W[like -w, but turn wildcards in replacement patterns into references]' \
+  '1:source pattern:_files' \
+  '2:desination pattern:_files'
+  
+  
+  
Index: Doc/Zsh/contrib.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/contrib.yo,v
retrieving revision 1.22
diff -u -r1.22 contrib.yo
--- Doc/Zsh/contrib.yo	5 Aug 2002 12:33:27 -0000	1.22
+++ Doc/Zsh/contrib.yo	7 Jan 2003 15:45:33 -0000
@@ -961,8 +961,8 @@
 )
 findex(zcp)
 findex(zln)
-xitem(tt(zcp) [ tt(-finqQvw) ] var(srcpat) var(dest))
-item(tt(zln) [ tt(-finqQsvw) ] var(srcpat) var(dest))(
+xitem(tt(zcp) [ tt(-finqQvwW) ] var(srcpat) var(dest))
+item(tt(zln) [ tt(-finqQsvwW) ] var(srcpat) var(dest))(
 Same as tt(zmv -C) and tt(zmv -L), respectively.  These functions do not
 appear in the zsh distribution, but can be created by linking tt(zmv) to
 the names tt(zcp) and tt(zln) in some directory in your tt(fpath).
@@ -973,7 +973,7 @@
 ifnzman((noderef(Utilities))).
 )
 findex(zmv)
-item(tt(zmv) [ tt(-finqQsvw) ] [ -C | -L | -M | -p var(program) ] [ -o var(optstring) ] var(srcpat) var(dest) )(
+item(tt(zmv) [ tt(-finqQsvwW) ] [ -C | -L | -M | -p var(program) ] [ -o var(optstring) ] var(srcpat) var(dest) )(
 Move (usually, rename) files matching the pattern var(srcpat) to
 corresponding files having names of the form given by var(dest), where
 var(srcpat) contains parentheses surrounding patterns which will be
@@ -1008,6 +1008,8 @@
 sitem(tt(-v))(Verbose: print each command as it's being executed.)
 sitem(tt(-w))(Pick out wildcard parts of the pattern, as described above,
 and implicitly add parentheses for referring to them.)
+sitem(tt(-W))(Just like tt(-w), with the addition of turning wildcards in
+the replacement pattern into sequential ${1} .. ${N} references.)
 sxitem(tt(-C))
 sxitem(tt(-L))
 sitem(tt(-M))(Force tt(cp), tt(ln) or tt(mv), respectively, regardless of

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



Messages sorted by: Reverse Date, Date, Thread, Author