zsh-workers
 help / color / mirror / code / Atom feed
* Re: _cvs(&_arguments) bug
@ 2002-01-09  7:26 Felix Rosencrantz
  0 siblings, 0 replies; 6+ messages in thread
From: Felix Rosencrantz @ 2002-01-09  7:26 UTC (permalink / raw)
  To: zsh-workers

I wouldn't mind "-:" or "---".  I really don't like -E or dash followed by any
letter, where it could accidentally be confused again.  Whatever, solution, it
should be something that couldn't accidentally be confused.

I've been big on automatically generating _arguments calls, and would like any
solution to be something that can be applied in brain dead manner without
problem.

The _argument docs could use a little reorganizing.

-FR.

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: _cvs(&_arguments) bug
@ 2002-02-19  6:49 Felix Rosencrantz
  0 siblings, 0 replies; 6+ messages in thread
From: Felix Rosencrantz @ 2002-02-19  6:49 UTC (permalink / raw)
  To: zsh-workers

Thanks Sven.  A single colon works for me.  I previously posted a patch that
fixed the problem in _cvs by reordering the arguments, so _cvs no longer has
the bug I hit.  I have some pending patches for _cvs that I want to submit
at some point.  Maybe I'll add in colons for _cvs, also.  But it might be a
while before I have time...

-FR.

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: _cvs(&_arguments) bug
  2001-12-28  5:59 Felix Rosencrantz
  2002-01-08 15:15 ` Sven Wischnowsky
@ 2002-02-18 14:33 ` Sven Wischnowsky
  1 sibling, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 2002-02-18 14:33 UTC (permalink / raw)
  To: zsh-workers


Felix Rosencrantz wrote:

> ...
> 
> Though, I think _arguments should also be modified to provide a way to say that
> there is an end to the flags being given to _arguments, and the specifications
> are starting.  It's an easy mistake to make.

Here is a patch. It uses `:' as the separator-argument (separating
options to _Arguments from specs). I hope that's ok for everyone, if
not it can easily be changed.

The patch neither cleans up the docs for _arguments nor changes it
functions using _Arguments to make use of `:'. Didn't have the time,
sorry.


Bye
  Sven

Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.144
diff -u -r1.144 compsys.yo
--- Doc/Zsh/compsys.yo	12 Feb 2002 17:25:23 -0000	1.144
+++ Doc/Zsh/compsys.yo	18 Feb 2002 14:30:59 -0000
@@ -2996,12 +2996,15 @@
 different name for the argument context field.
 )
 findex(_arguments)
-item(tt(_arguments) [ tt(-ACS) ] [ tt(-O) var(name) ] [ tt(-M) var(matchspec) ] var(spec) ...)(
+item(tt(_arguments) [ tt(-ACS) ] [ tt(-O) var(name) ] [ tt(-M) var(matchspec) ] [ tt(:) ] var(spec) ...)(
 This function can be used to complete words on the line by describing the
 options and arguments which may be passed to the command for which
 completion is being performed.  The description is given as arguments to
 this function, with each var(spec) describing one option or normal
-argument of the command.  The forms of var(spec) understood are:
+argument of the command.  To separate these var(spec)s from the
+options given to tt(_arguments) itself, they can be preceeded by an
+argument containing a single colon.  The forms of var(spec)
+understood are:
 
 startitem()
 xitem(var(n)tt(:)var(message)tt(:)var(action))
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.75
diff -u -r1.75 computil.c
--- Src/Zle/computil.c	7 Feb 2002 08:40:03 -0000	1.75
+++ Src/Zle/computil.c	18 Feb 2002 14:31:00 -0000
@@ -1065,6 +1065,8 @@
 
 	args++;
     }
+    if (*args && !strcmp(*args, ":"))
+        args++;
     if (!*args)
 	return NULL;
 

-- 
Sven Wischnowsky                          wischnow@berkom.de


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: _cvs(&_arguments) bug
  2002-01-08 15:15 ` Sven Wischnowsky
@ 2002-01-08 17:07   ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-01-08 17:07 UTC (permalink / raw)
  To: zsh-workers

On Jan 8,  4:15pm, Sven Wischnowsky wrote:
}
} Felix Rosencrantz wrote:
} 
} > Though, I think _arguments should also be modified to provide a way to
} > say that there is an end to the flags being given to _arguments, and the
} > specifications are starting.  It's an easy mistake to make.
} 
} Yes, I've been thinking the same some time ago, but couldn't find a
} good `marker' that can be used to separate the _arguments-options from
} the specifications.  Any ideas?

I always wondered about the wisdom of making `--' mean something other
than "end of the _arguments options."

Just pick another option character; -e or -E or -: or some such.

And document it in a less-well-hidden spot.  The -A might be less likely to
cause such problems with the following patch:

Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Doc/Zsh/compsys.yo,v
retrieving revision 1.13
diff -c -r1.13 compsys.yo
--- Doc/Zsh/compsys.yo	2002/01/07 15:18:21	1.13
+++ Doc/Zsh/compsys.yo	2002/01/08 17:05:05
@@ -2955,7 +2955,7 @@
 different name for the argument context field.
 )
 findex(_arguments)
-item(tt(_arguments) var(spec) ...)(
+item(tt(_arguments) [ tt(-ACS) ] [ tt(-O) var(name) ] [ tt(-M) var(matchspec) ] var(spec) ...)(
 This function can be used to complete words on the line by describing the
 options and arguments which may be passed to the command for which
 completion is being performed.  The description is given as arguments to


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: _cvs(&_arguments) bug
  2001-12-28  5:59 Felix Rosencrantz
@ 2002-01-08 15:15 ` Sven Wischnowsky
  2002-01-08 17:07   ` Bart Schaefer
  2002-02-18 14:33 ` Sven Wischnowsky
  1 sibling, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2002-01-08 15:15 UTC (permalink / raw)
  To: zsh-workers


Felix Rosencrantz wrote:

> There is a bug with the _cvs completion functions.  Though, I would also
> say it is also bug in _arguments.
> 
> The problem occurs with the functions _cvs_update & _cvs_checkout.
> The problem is that the "-A" flag does not get completed for these
> sub-commands, when it should be.  The reason is that the intended "-A"
> specification is being interpreted as a flag to _arguments, rather than
> as a specification.
> 
> The fix is easy for the _cvs_* functions; just move the intended -A
> specifications from the front of the list.
> 
> Though, I think _arguments should also be modified to provide a way to say that
> there is an end to the flags being given to _arguments, and the specifications
> are starting.  It's an easy mistake to make.

Yes, I've been thinking the same some time ago, but couldn't find a
good `marker' that can be used to separate the _arguments-options from
the specifications.  Any ideas?


Bye
  Sven

-- 
Sven Wischnowsky                           wischnow@berkom.de


^ permalink raw reply	[flat|nested] 6+ messages in thread

* _cvs(&_arguments) bug
@ 2001-12-28  5:59 Felix Rosencrantz
  2002-01-08 15:15 ` Sven Wischnowsky
  2002-02-18 14:33 ` Sven Wischnowsky
  0 siblings, 2 replies; 6+ messages in thread
From: Felix Rosencrantz @ 2001-12-28  5:59 UTC (permalink / raw)
  To: zsh-workers

There is a bug with the _cvs completion functions.  Though, I would also
say it is also bug in _arguments.

The problem occurs with the functions _cvs_update & _cvs_checkout.
The problem is that the "-A" flag does not get completed for these
sub-commands, when it should be.  The reason is that the intended "-A"
specification is being interpreted as a flag to _arguments, rather than
as a specification.

The fix is easy for the _cvs_* functions; just move the intended -A
specifications from the front of the list.

Though, I think _arguments should also be modified to provide a way to say that
there is an end to the flags being given to _arguments, and the specifications
are starting.  It's an easy mistake to make.

-FR.

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-02-19  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-09  7:26 _cvs(&_arguments) bug Felix Rosencrantz
  -- strict thread matches above, loose matches on Subject: below --
2002-02-19  6:49 Felix Rosencrantz
2001-12-28  5:59 Felix Rosencrantz
2002-01-08 15:15 ` Sven Wischnowsky
2002-01-08 17:07   ` Bart Schaefer
2002-02-18 14:33 ` Sven Wischnowsky

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).