From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8798 invoked from network); 21 Jul 2001 13:54:26 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jul 2001 13:54:26 -0000 Received: (qmail 9489 invoked by alias); 21 Jul 2001 13:54:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15439 Received: (qmail 9478 invoked from network); 21 Jul 2001 13:54:18 -0000 X-VirusChecked: Checked Sender: kiddleo@cav.logica.co.uk Message-ID: <3B598984.658F86AC@u.genie.co.uk> Date: Sat, 21 Jul 2001 14:54:12 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Felix Rosencrantz CC: zsh-workers Subject: Re: Generating completion functions from XML References: <20010721011604.81202.qmail@web10401.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Felix Rosencrantz wrote: > There are more options on what flags are exclusive and equivalent, > and many times this information has to be repeated. Note that the exclusion lists are not necessarily repeated. An option listed in the exclusion list is excluded after the option and there are some commands where the exclusion is dependant on the ordering. I can't think of much information repetition in the current _arguments syntax. Another thing we could do is modify GNU gengetopts (which produces C calls to getopt_long) to additionally output the basis of a completion function. Whether they would include our change, I don't know with zsh not being GNU. > 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. Have you used XSLT at all? I've used it for some things and it is quite cunning. If you use XML, I'd recommend you try it with this transformation in mind. I actually struggled to find a decent program to do XSL transformations - most of the information on the web relates to direct browser support yet it makes a lot of sense currently to use XSL on the server side. libxslt (which needs libxml2) comes with a little program called xsltproc which is what I have used (and I have a simple completion for it so I've attached that). Another thing you might want to think about is if your XML format can somehow be flexible enough to include support for multiple languages. It'll be interesting to see but to be honest I'm a bit doubtful that an XML equivalent will be any easier to modify or understand that the current script. A gui wizard might do more to easing things but then that could use the XML. The completion functions may not have gained much in ease of writing over compctls (and as you said this is largely because of the provision greater functionality) but I think they are a lot more readable. I could never remember all the compctl flags and always needed the manual to write them whereas tcsh completes were easy. Oliver #compdef xsltproc _arguments -C \ -v --{verbose,timing,repeat,debug,novalid,noout,maxdepth} \ '1:stylesheet:_files -g \*.xsl' \ ':file:_files -g \*.xml' _____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp