summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Zsh/Command/.distfiles2
-rw-r--r--Completion/Zsh/Command/_zmv18
-rw-r--r--Doc/Zsh/contrib.yo8
4 files changed, 28 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 68b6cdf1b..efa4ba7bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2003-01-07  Oliver Kiddle  <opk@zsh.org>
 
+	* 18060: Completion/Zsh/Command/_zmv, Doc/Zsh/contrib.yo,
+	Completion/Zsh/Command/.distfiles: document zmv's -W option and
+	add a completion for zmv
+
 	* 18058: Completion/Unix/Command/_lsof, Completion/Unix/Command/_mt,
 	Completion/Unix/Command/_xsltproc, Completion/Unix/Command/_rlogin,
 	Completion/Unix/Command/_ssh, Completion/Unix/Command/_ant,
diff --git a/Completion/Zsh/Command/.distfiles b/Completion/Zsh/Command/.distfiles
index 40275afbe..544daf4c1 100644
--- a/Completion/Zsh/Command/.distfiles
+++ b/Completion/Zsh/Command/.distfiles
@@ -2,7 +2,7 @@ DISTFILES_SRC='
 .distfiles
 _alias     _disable  _jobs_builtin  _read    _ttyctl    _which     _zstyle
 _autoload  _echotc   _kill          _sched   _typeset   _zcompile  _dirs
-_bindkey   _echoti   _limit         _set     _ulimit    _zed
+_bindkey   _echoti   _limit         _set     _ulimit    _zed       _zmv
 _builtin   _emulate  _mere          _setopt  _unhash    _zftp
 _cd        _enable   _precommand    _source  _unsetopt  _zle
 _command   _fc       _print         _stat    _vared     _zmodload
diff --git a/Completion/Zsh/Command/_zmv b/Completion/Zsh/Command/_zmv
new file mode 100644
index 000000000..bc639f3ec
--- /dev/null
+++ b/Completion/Zsh/Command/_zmv
@@ -0,0 +1,18 @@
+#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'
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 46d208f6c..980c982a3 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -961,8 +961,8 @@ not exist; it is created on write, if necessary.
 )
 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 @@ ifzman(above)\
 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(-s))(Symbolic, passed down to tt(ln); only works with tt(-L).)
 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