From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12402 invoked by alias); 18 Nov 2009 00:59:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27415 Received: (qmail 29114 invoked from network); 18 Nov 2009 00:59:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <091117075505.ZM9595@torch.brasslantern.com> Date: Tue, 17 Nov 2009 07:55:05 -0800 In-reply-to: <091116200143.ZM31202@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: minor niggle with svn completion of sub-commands" (Nov 16, 8:01pm) References: <19192.17676.966894.118536@gargle.gargle.HOWL> <20091112192553.2d76ce1d@pws-pc> <091115161750.ZM29484@torch.brasslantern.com> <091116200143.ZM31202@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: comparguments (was Re: minor niggle with svn completion of sub-commands) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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 ||