zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: --help trough _use_lo , but how with -h style?
Date: Wed, 28 Jun 2000 15:12:45 +0200 (MET DST)	[thread overview]
Message-ID: <200006281312.PAA32564@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Matthias Kopfermann's message of Wed, 28 Jun 2000 15:02:34 +0200


Matthias Kopfermann wrote:

> Hi again,
> After I got the information about the use of `compdef _use_lo x y z' to
> have x y and z commands completed I asked myself:
> How can i do it with these `-h' commands. e.g. mutt only wants 
> -x flags. i would like to have such commands being completed just
> like the much nicer to read --x commands. is there a function
> already for these kind of commands? (I am not talking about a
> specific mutt completion though that may be nice, too.)
> 
> BTW: i used to use perl for having --help commands being
> completed and i have a function that does it with -h commands ,
> too,  but it would be much nicer, if there was such a function in
> plain-zsh already. Thats why i ask.

No, we don't have that yet. But we have a completion function for mutt.


Hm, if you have a function to generate the option names you can easily 
use that. I guess the function puts the options into the $reply array
(I'll assume the strings generated include the `-'), so you can do:

  _use_so() { # ;-)
    if [[ $PREFIX = -* ]]; then
      ... # call perl-function-thingy
      compadd -a reply
    else
      _default
    fi
  }

To make this nicer, change the `compadd'-line to:

  local expl
  _wanted options expl option compadd -a reply


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


         reply	other threads:[~2000-06-28 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-28 13:02 Matthias Kopfermann
2000-06-28 13:12 ` Sven Wischnowsky [this message]
2000-06-28 13:22 ` Andrej Borsenkow
2000-06-28 15:56   ` Bart Schaefer

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=200006281312.PAA32564@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).