From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6803 invoked from network); 26 Jun 2000 10:45:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Jun 2000 10:45:50 -0000 Received: (qmail 13063 invoked by alias); 26 Jun 2000 10:45:31 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3208 Received: (qmail 13055 invoked from network); 26 Jun 2000 10:45:26 -0000 Date: Mon, 26 Jun 2000 12:45:01 +0200 (MET DST) Message-Id: <200006261045.MAA19122@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-users@sunsite.auc.dk In-reply-to: Matthias Kopfermann's message of Mon, 26 Jun 2000 12:30:49 +0200 Subject: Re: (forw) --help able programs and completion Matthias Kopfermann wrote: > On Mon, Jun 26, 2000 at 11:20:20AM +0100, Peter Stephenson wrote: > > Use compinstall. I would like feedback, but the format is restricted by > > the fact that it will be written in zsh, so there are menus but no dialogue > > boxes. > Which is really an approach in the right direction. Now my > question is: Where do i find the `--help' completion here? Nowhere. compinstall is about configuration with styles (mostly). What you need is to tell the completion system to use a certain function to complete after the commands in question. That's done with `compdef': compdef We have a function to complete the options described by the `--help' output, it's called `_use_lo', so, once you have identified all the commands for which completion should call the command with `--help' and complete the options, you can do: compdef _use_lo cmd1 cmd2 cmd3 ... In normal setup, _use_lo is only used for `gls' because we have to be careful. Not every Unix supports `--help' for (almost) every command and to complete the options, we have to call the command which may be dangerous if it doesn't understand `--help', obviously. To -workers (and to anyone who wants to use the above): it seems _use_lo wasn't updated for quite some time, the patch below should make it more user-friendly. Bye Sven Index: Completion/User/_use_lo =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/User/_use_lo,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 _use_lo --- Completion/User/_use_lo 2000/03/11 00:05:30 1.1.1.6 +++ Completion/User/_use_lo 2000/06/26 10:41:34 @@ -3,4 +3,4 @@ # This is for GNU-like commands which understand the --help option, # but which do not otherwise require special completion handling. -_arguments -- || _default +_arguments '*:arg: _default' -- -- Sven Wischnowsky wischnow@informatik.hu-berlin.de