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

Re: _cvs(&_arguments) bug



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@xxxxxxxxx



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