zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: (forw) --help able programs and completion
Date: Mon, 26 Jun 2000 12:45:01 +0200 (MET DST)	[thread overview]
Message-ID: <200006261045.MAA19122@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Matthias Kopfermann's message of Mon, 26 Jun 2000 12:30:49 +0200


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 <func-to-call> <commands...>

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


             reply	other threads:[~2000-06-26 10:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-26 10:45 Sven Wischnowsky [this message]
     [not found] <no.id>
2000-06-26 10:23 ` Matthias Kopfermann
2000-06-26 10:30 ` Matthias Kopfermann
  -- strict thread matches above, loose matches on Subject: below --
2000-06-26 10:14 Roland Jesse
2000-06-26 10:20 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200006261045.MAA19122@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).