From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12871 invoked from network); 19 Jul 2001 08:57:25 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jul 2001 08:57:25 -0000 Received: (qmail 23930 invoked by alias); 19 Jul 2001 08:57:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15416 Received: (qmail 23914 invoked from network); 19 Jul 2001 08:57:06 -0000 From: Sven Wischnowsky Date: Thu, 19 Jul 2001 10:56:49 +0200 (MET DST) Message-Id: <200107190856.KAA08273@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: Generating completion functions from XML In-Reply-To: <20010719015254.32691.qmail@web10401.mail.yahoo.com> Felix Rosencrantz wrote: > ... > > But I suspect any scripts would still hit some sort of 90/10 rule. > It'll get you 90% of the way but there will still be the final 10% > which will have to be done manually. It might be useful if it manages to automate more than 50% of the process, leaving the rest to the user... > So I feared having to look at partially wrong _arguments calls. That > command has a lot of syntactic sugar and there is more on the way (e.g. > recent changes). It's not easy for me to remember what each special > character and grouping does. Actually, the reason why some of the _argument calls hurt the eyes is that it has so littly syntactic sugar. And I hope there won't be any changes to the _arguments syntax (or at least nothing dramatic). That's part of the reason why I used `same description' as the condition on which to group in _describe. > It occurred to me that having an intermediate file format would be a > good idea. Possibly something that would be a little more descriptive, > maybe even interspersed with comments and documentation (both from > zsh & the command). Also it should be easier to edit. Also, it > should make it easier to specify commands that have subcommands (e.g. > cvs). There would need to be a tool which transform this intermediate > file format into the appropriate completion function, generating the > appropriate call to _arguments, _values, etc. Also, as the syntax to > _arguments changed it would be possible to change this generation tool, > and then regenerate the completion function. Maybe even _arguments > could even take this intermediate format file as input. Btw. have you noticed Bart's _arg_compile function? I'm not opposed to defining some language to make describing commands easier at all. Be it XML or something else (everything has to be XML nowadays, right? at least until the next hype... ;-). But it's not simple to define, really. Especially if you think about commands like _cvs which does *a lot* besides calling _arguments, things that are best described with the shell code needed to do them, I think. I'll try to make helpful comments when you start describing the language you have in mind. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de