From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: comparguments (was Re: minor niggle with svn completion of sub-commands)
Date: Tue, 17 Nov 2009 07:55:05 -0800 [thread overview]
Message-ID: <091117075505.ZM9595@torch.brasslantern.com> (raw)
In-Reply-To: <091116200143.ZM31202@torch.brasslantern.com>
On Nov 16, 8:01pm, Bart Schaefer wrote:
}
} I begin to think the test really belongs in the "for" statement loop
} conditions at the top. "line && !ca_laststate.def" rather than just
} "line".
So it turns out that breaks :*PATTERN:::MESSAGE:ACTION in optspecs.
Fortunately there's a check for that one in the test suite.
Here's a patch I think is worth committing.
--- computil.c.~1.116.~ 2009-08-31 07:24:38.000000000 -0700
+++ computil.c 2009-11-17 07:53:43.000000000 -0800
@@ -2133,6 +2133,23 @@
if ((adef = state.def = ca_get_arg(d, state.nth)) &&
(state.def->type == CAA_RREST ||
state.def->type == CAA_RARGS)) {
+
+ /* Bart 2009/11/17:
+ * We've reached the "rest" definition. If at this point
+ * we already found another definition that describes the
+ * current word, use that instead. If not, prep for the
+ * "narrowing" of scope to only the remaining words.
+ *
+ * We can't test ca_laststate.def in the loop conditions
+ * at the top because this same loop also handles the
+ * ':*PATTERN:MESSAGE:ACTION' form for multiple arguments
+ * after an option, which may need to continue scanning.
+ * There might be an earlier point at which this test can
+ * be made but tracking it down is not worth the effort.
+ */
+ if (ca_laststate.def)
+ break;
+
state.inrest = 0;
state.opt = (cur == state.nargbeg + 1 &&
(!multi || !*line ||
next prev parent reply other threads:[~2009-11-18 0:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-09 16:36 minor niggle with svn completion of sub-commands Greg Klanderman
2009-11-09 21:46 ` Greg Klanderman
2009-11-12 17:53 ` Greg Klanderman
2009-11-12 19:25 ` Peter Stephenson
2009-11-14 20:05 ` Greg Klanderman
2009-11-15 7:47 ` Greg Klanderman
2009-11-16 0:17 ` Bart Schaefer
2009-11-16 19:45 ` Greg Klanderman
2009-11-17 4:01 ` Bart Schaefer
2009-11-17 15:55 ` Bart Schaefer [this message]
2009-12-06 22:11 ` comparguments (was Re: minor niggle with svn completion of sub-commands) Greg Klanderman
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=091117075505.ZM9595@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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).