From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1026 invoked from network); 4 Feb 2000 13:16:52 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Feb 2000 13:16:52 -0000 Received: (qmail 27527 invoked by alias); 4 Feb 2000 13:16:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9566 Received: (qmail 27520 invoked from network); 4 Feb 2000 13:16:43 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: _arguments problems References: <200002040959.KAA23014@beta.informatik.hu-berlin.de> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 04 Feb 2000 22:16:39 +0900 In-Reply-To: Sven Wischnowsky's message of "Fri, 4 Feb 2000 10:59:39 +0100 (MET)" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <200002040959.KAA23014@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > > is27e1u11% _tst () { _arguments '-a' '*::rest:_tst2' } > > is27e1u11% _tst2 () { compadd - '-b' } > > is27e1u11% tst arg - > > -b > > -a > > > > This completes `-a' and `-b' but it shouldn't completes `-a'. > > Hm. I see why you think it shouldn't and it can be achieved by > applying the first hunk below. > > *But* if we do that there wouldn't be a way to get at the options in > cases like this one (ok, it works with longer options but with short > ones like these one would have to type the whole option to complete > it). I'm really not sure if this is a good idea, I could only convince > myself to build that patch because one can always set the > prefix-needed style to false for such commands. > > I'd like to hear other opinions: does anyone think that this might > surprise users? Or maybe I'm worrying too much about to special a > case... I intended to use that for _cvs. Since valid options are quite different before and after non-option first argument, it is trouble that _arguments in _tst1 and _cvs completes options over non-option first argument. If _arguments behaves so, _cvs completes global options for subcommands as: Z(2):akr@is27e1u11% cvs add - option --allow-root --help-options -H -a -e -l -q -t -x --help --help-synonyms -Q -b -f -m -r -v -z --help-commands --version -T -d -k -n -s -w Options except `-k' and `-m' are global options and they are only valid between `cvs' and `add'. So, I think following behaviour is also problem. is27e1u11% _tst () { _arguments '-a' '*::rest:(rest)' } is27e1u11% tst arg - -> is27e1u11% tst arg -a Because I think _arguments shouldn't completes options after an argument handled by `*::message:action'. -- Tanaka Akira