From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22366 invoked by alias); 16 Jan 2013 13:49:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17571 Received: (qmail 6172 invoked from network); 16 Jan 2013 13:49:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_40,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1358343807; bh=vC09LG7iGdfZpA/JKaOVps8Pg7K38AmpES13BnqavqY=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:cc:In-reply-to:From:References:To:Subject:Date:Message-ID; b=aAoDsQwVzvZkhtx15JHiXiWf89MGwT3SXxP3NsS9ljvouuxTeF14qg3gy3DAZZcHpZwMkk0mPjD+NsSl/mYKfUwFzfr6SOU1qNOILDgVgcpUNhG/LUkXgTE+N4qeqwD7NY86wF6fA//j57J0tHZIX3xnjASTDgQIGGScA84CCcg= X-Yahoo-Newman-Id: 817850.93328.bm@smtp135.mail.ird.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3fl9JWIVM1lmUQo27Khxks7PN3tV8Grdd6lqy28mRK_5g1I Eb31G3j_P0CYmclZBFwJH8I_eimJ.kGm3wZFZdTkSKmoBBjDZvraDofbiRkA sud7UZKujwZX9wmtY4U7q8_e.3uf.Yn94P0FH0fC.luz2d8fS3xjcFh_U3CP yNhmwD12aUtPF7PIz20lpbiZz40buJWo3UI3l9.bM97nG88u.1ws6HE.GAy5 tbiD.gjcFiEMVe5U2h.bqM9qBDifPJCiBo6vcsMLtbMuS7i2DzkV77_0_kc2 HyUK7pixvwLtxyoAyHjuH6ja_1aeEMi85WXhC2W9xMnf.eENVQQIK_WW1KIv JQenJt6ULVN8ZMht6Cn_UCNqrtoP2iO01J9AypKNN_LCkmdCsAe54pmRQ.qX gCpPynmUM3aM_SnYz7PtUo3mJfSgEHK81XLD6FEX_Hix.ug-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: zsh-users@zsh.org In-reply-to: From: Oliver Kiddle References: To: =?ISO-8859-1?Q?Jesper_Nyg=E5rds?= Subject: Re: Setting state in _arguments Date: Wed, 16 Jan 2013 14:43:26 +0100 Message-ID: <20477.1358343806@thecus.kiddle.eu> =?ISO-8859-1?Q?Jesper_Nyg=E5rds?= wrote: > On the command line, I write: "myfoo --", and the completion kicks in > and gives me the options "--option1" and "--option2", which is what I > expected. However, on /dev/pty2 I see "state: subcommand", which I did NOT > expect. I would have thought that since only "--option1" or "--option2" > could possibly match after "--", state would not have been set*, *but it is. _arguments has no way of knowing that subcommands can't begin with "--" so while it adds the completion matches for the options, it also considers the *:... rule to be applicable. > The trouble with this is that in the gradle completion, the possible > subcommands are generated inside the if statement in this case, and thatis > time consuming. I would thus like to avoid going into it when the "--" on > the command line indicates that an option should be completed. You can perform some explicit tests before starting the time consuming operation, perhaps test whether the current word starts with "--". Oliver