From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5161 invoked from network); 12 May 2000 07:36:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 May 2000 07:36:20 -0000 Received: (qmail 12431 invoked by alias); 12 May 2000 07:35:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11338 Received: (qmail 12420 invoked from network); 12 May 2000 07:35:51 -0000 Date: Fri, 12 May 2000 09:35:48 +0200 (MET DST) Message-Id: <200005120735.JAA09941@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Fri, 12 May 2000 02:53:02 +0000 Subject: Re: PATCH: Re: Assorted _arguments arguments Bart Schaefer wrote: > ... > > I haven't really worked at understanding _argument_sets very much, but: > > As I understand it, _argument_sets only works for fairly simple option > combinations. As soon as you start needing ->state and the like, it's > necessary to revert to using _arguments directly. Is it possible to > combine the two in some useful way so that it isn't necessary to give > up the above convenience in order to do more complex parsing? The only real problem _argument_sets currently has with `->state' actions is when there are more than one state returned at the same time. Especially for actions defined in the common options/args part: you'll get the state/context more than once in $state and $context (and just using `typeset -U' doesn't work, because the contexts may be different, including the set-name). However, _argument_sets was mostly written to give us a way to play with this, test it. The syntax (the `-' to separate sets) was chosen because `-' currently makes comparguments/_arguments report an invalid argument. So... we could try to put the whole functionality of _argument_sets into _arguments, implement it (mostly) in C. I would then write it there as we have it in shell code now: as a wrapper around the existing code. That was the problem that led to the implementation we have now: changing all of comparguments to support multiple sets is extremly complicated (and error-prone). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de