zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: PATCH: Re: _rsync duplicated options in completion
Date: Tue, 21 May 2002 09:43:21 +0200	[thread overview]
Message-ID: <15593.64153.239356.108265@wischnow.berkom.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0205180932370.8000-100000@phong.blorf.net>


Wayne Davison wrote:

> On Thu, 16 May 2002, Bart Schaefer wrote:
> > The problem is that the `--' argument to _arguments is causing the
> > output from `rsync --help' to be merged with the long list of options
> > provided in the completion function itself.  Instead of recognizing
> > that there are overlaps, every option is being presented twice.
> 
> I've discovered that the problem stems from the rsync options containing
> "--foo=BAR" items (such as --ignore=FILE and --include=PATTERN) while
> the options in the _rsync file only say "--foo=".  [...]

Yep.

> This makes the duplicated-option bug goes away.  Someone may want to
> translate that into a zsh expansion pattern to avoid the call to sed.
> OR, we may want to add the ability to specify an option like
> "--include=PATTERN" in the _rsync file and have the PATTERN part only
> show up as part of the help text, but not be included when completing
> the option name.

Strange, when I found the bug, I thought about automatically including
it in the description, too. No patch for that yet, though (and even
then user-defined specs should take preference).


Plus a fix for a typo in _rsync.


Bye
  Sven

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.12
diff -u -r1.12 _arguments
--- Completion/Base/Utility/_arguments	14 May 2002 08:08:45 -0000	1.12
+++ Completion/Base/Utility/_arguments	21 May 2002 07:41:42 -0000
@@ -74,11 +74,11 @@
     # Remove options also described by user-defined specs.
 
     tmp=()
-    for opt in "${(@)lopts:#--}"; do
+    for opt in "${(@)${(@)lopts:#--}%%\=*}"; do
 
       # Using (( ... )) gives a parse error.
 
-      let "$tmpargv[(I)(|\([^\)]#\))(|\*)${opt}(|[-+=])(|\[*\])(|:*)]" ||
+      let "$tmpargv[(I)(|\([^\)]#\))(|\*)${opt}(|[-+]|=(|-))(|\[*\])(|:*)]" ||
           tmp=( "$tmp[@]" "$opt" )
     done
     lopts=( "$tmp[@]" )
Index: Completion/Unix/Command/_rsync
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rsync,v
retrieving revision 1.4
diff -u -r1.4 _rsync
--- Completion/Unix/Command/_rsync	16 Apr 2002 07:48:46 -0000	1.4
+++ Completion/Unix/Command/_rsync	21 May 2002 07:41:43 -0000
@@ -121,7 +121,7 @@
  	'(--whole-file)-W[copy whole files]' \
  	'(-W)--whole-file[copy whole files]' \
  	'(--one-file-system)-x[do not cross filesystem boundaries]' \
- 	'(-x)-one-file-system[do not cross filesystem boundaries]' \
+ 	'(-x)--one-file-system[do not cross filesystem boundaries]' \
  	'(--block-size)-B[checksum blocking size]:block size:' \
  	'(-B)--block-size=[checksum blocking size]:block size:' \
  	'(--rsh)-e[rsh command]:remote command:(rsh ssh)' \

-- 
Sven Wischnowsky                          wischnow@berkom.de


  reply	other threads:[~2002-05-21  7:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-15 20:52 Wayne Davison
2002-05-16  2:18 ` Clint Adams
2002-05-16 17:10   ` Bart Schaefer
2002-05-18 16:46     ` Wayne Davison
2002-05-21  7:43       ` Sven Wischnowsky [this message]
2002-05-23 12:18         ` PATCH: " Sven Wischnowsky
2002-05-21  7:37     ` Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15593.64153.239356.108265@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).