From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6145 invoked from network); 23 Apr 2001 09:00:44 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Apr 2001 09:00:44 -0000 Received: (qmail 8129 invoked by alias); 23 Apr 2001 09:00:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14069 Received: (qmail 8115 invoked from network); 23 Apr 2001 09:00:36 -0000 Sender: kiddleo Message-ID: <3AE3EF09.C25C8DF8@u.genie.co.uk> Date: Mon, 23 Apr 2001 09:59:53 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.15 i686) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.dk Subject: Re: problem with _arguments exclusion lists References: <200104200831.KAA14053@beta.informatik.hu-berlin.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sven Wischnowsky wrote: > > 1) Add an option to _arguments, that says that it should always try to > complete options after options specified with `-x-:...' or `-x+:...'. > 2) Also, make it try completing options in those places even if the new > _arguments-option is not given but the action for the argument > returns non-null. I'm happy with that. > The `returns non-null' is, of course, problematic again if the option- > argument has to be completed with a `->state' action. But I think if That's a bit of a pity. > And add a small utility function that can be put into an argument- > action and tests if the string typed so far matches some pattern. Agreed. > For simplicity I would make it use the description given in the > _arguments-spec. I'll be interested to see how you do that. I think the function will have wider uses than just from _arguments such as from _alternative so it would be good if it can cope with that. > And if a simple pattern match is enough for most > cases, this makes it sound as if we should just add a new action- > syntax, avoiding the need for an extra function consisting of only I prefer the extra two-line function to extending _arguments' action spec syntax. The function is a more general method which may be more widely useful and it keeps things more in zsh shell syntax than in _arguments syntax. Also, I can't see that guards on _arguments specs would be particularly useful when matches are generated. > Ok, would this be enough for now? Later we can, as suggested by Oliver, > add a way to change the behaviour on a per-option basis, using the > option from 1) as the default. If we ever meet a command that needs > that much control. Agreed. Oliver