From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14485 invoked from network); 14 Jan 2002 00:19:56 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Jan 2002 00:19:56 -0000 Received: (qmail 29145 invoked by alias); 14 Jan 2002 00:19:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16438 Received: (qmail 29133 invoked from network); 14 Jan 2002 00:19:50 -0000 Message-ID: <20020114001948.32808.qmail@web10401.mail.yahoo.com> Date: Sun, 13 Jan 2002 16:19:48 -0800 (PST) From: Felix Rosencrantz Subject: Re: Zsh Completion function generation via XML To: zsh-workers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sven Wischnowsky wrote: >Felix Rosencrantz wrote: > >> ... [XML stuff] > >That looks friendlier than before. Only two remarks: > >> _arguments \ >> ... >> '*:Handling Tag _files:->_files' > >There should at least be a `&& return 0' after the last spec. Thanks. I'll add that in. >But, and that's the second remark, I strongly suggest that you don't >use states for every action, or states at all. They actually are the >worst case for _arguments, because it has to give up control. It's >also the most complicated and probably far from bug-free. Ahem. > >Maybe use small sub-functions if you can't be bothered to find out if >the action can be put into the specs themselves. Actually that something that can be configured in arg.xsl. The arg.xsl stylesheet has a parameter, the way you can hand an argument to an XSLT script. This the comment, I default to "state": ActionTagGeneration says how to generate an action where only an action tag is available. Current values are: When I was doing the clearcase completion, I was using something closer to 'handler', which would generate calls to clearcase_* functions. The problem with that is the user had to write/stub those functions, or there would be a lot of errors. (Though I guess my script could stub them....) I guess what I'm hoping, is that I give help2simple.pl some heuristics for picking appropriate type functions (i.e. functions under the Completion/*/Type) for arguments. The heuristics would be common sense things, like if the argument name is pid, then guess _pids, or the argument name ends in "dir" use "_files -/". So there will be less states. In addition to heuristics, allow the user to specify the mapping of argtag names to functions. (Of course, there needs to be a completion function for help2simple.pl... :) ) -FR __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/