Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: optional argument?
- X-seq: zsh-workers 10915
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: optional argument?
- Date: Tue, 25 Apr 2000 13:47:32 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Tue, 25 Apr 2000 11:45:20 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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