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

Re: optional argument?



I wrote:

> ...
> 
> At the weekend I hacked on _arguments (and comparguments) to allow
> _arguments to complete more than one action when appropriate. And the
> case above is of course one of cases where it is done.

Just found out that I had forgotten to run diff again after the last
changes, sorry.

Bye
 Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.8
diff -u -r1.8 computil.c
--- Src/Zle/computil.c	2000/04/25 09:48:09	1.8
+++ Src/Zle/computil.c	2000/04/25 11:46:26
@@ -1399,7 +1399,7 @@
     for (; arg && (arg->num < 0 ||
 		   (arg->min <= ca_laststate.nth + addopt &&
 		    arg->num >= ca_laststate.nth));) {
-	if ((lopt = arg->type == CAA_OPT) && !opt && oopt > 0)
+	if (!opt && (lopt = arg->type != CAA_OPT) && oopt > 0)
 	    oopt = 0;
 
 	addlinknode(descr, arg->descr);
@@ -1446,7 +1446,7 @@
 	    }
 	}
     }
-    if (!single && opt && lopt) {
+    if (!single && opt && !lopt) {
 	opt = NULL;
 	arg = ca_get_arg(ca_laststate.d, ca_laststate.nth);
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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