zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: (forw) --help able programs and completion]
Date: Tue, 27 Jun 2000 15:18:57 +0200 (MET DST)	[thread overview]
Message-ID: <200006271318.PAA26871@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 26 Jun 2000 15:19:01 +0000


[ moved to workers ]

Bart Schaefer wrote:

> ...
> 
> } The one who wrote it probably should have documented it
> } somewhere.
> } 
> } I /think/ it wasn't me this time.
> 
> This is very interesting.
> 
> The earliest mention of _use_lo in the zsh-workers archive is PWS saying
> "What happened to _use_lo?  I don't remember removing it." just before he
> made the 3.1.6-test-1 release.  That's the first time it shows up in my
> home CVS repository, too.  The ChangeLog-Release file doesn't mention it
> at all until Sven started patching it (and the entire contents except for
> the comment at the top have long been Sven's doing, even if he didn't
> create the file originally).

Hm. Ok, ok. Here is a patchlet that also tries to emphasize compdef
because this is almost becoming a FAQ.

> Of course, the ChangeLog also doesn't make any mention of when _arguments
> acquired the internals of _long_options.

Lost when moving to CVS, I guess.

Bye
 Sven

Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.73
diff -u -r1.73 compsys.yo
--- Doc/Zsh/compsys.yo	2000/06/22 08:42:36	1.73
+++ Doc/Zsh/compsys.yo	2000/06/27 13:18:41
@@ -277,6 +277,20 @@
 )
 enditem()
 
+The tt(compdef) function is the place to turn to when one wants to
+define what the completion system should complete for a certain
+command.  The function named can of course be one of the functions
+supplied or one written by the user.  For example, if one has a
+command tt(foo) that gets process identifiers as arguments, one could
+do:
+
+example(compdef _pids foo)
+
+using the tt(_pids) function from the distribution to generate the
+process identifiers.  Not also the tt(_use_lo) function described
+below, which can be used to complete options for commands that
+understand the `tt(-)tt(-help)' option.
+
 texinode(Completion System Configuration)(Control Functions)(Initialization)(Completion System)
 sect(Completion System Configuration)
 cindex(completion system, configuration)
@@ -2672,6 +2686,25 @@
 
 Like tt(_tags) this function supports the tt(-C) option to give a
 different name for the argument context field.
+)
+findex(_use_lo)
+item(tt(_use_lo))(
+This function is a simple wrapper around the tt(_arguments) function
+described below.  It can be used to automatically complete long
+options for commands that understand the `tt(-)tt(-help)' option
+(`tt(_use_lo)' is for `use long options').  It is not intended to be
+used from completion functions but as a top-level completion function
+in its own right.  For example, to enable option completion for the
+commands tt(foo) and tt(bar), one would call:
+
+example(compdef _use_lo foo bar)
+
+in one of the initialization files after the call to tt(compinit).
+
+The default installation uses this function only to generate
+completions for some GNU-commands because to complete the options, the 
+command has to be called and hence it shouldn't be used if one can't
+be sure that the command understands the `tt(-)tt(-help)' option.
 )
 findex(_arguments)
 item(tt(_arguments) var(spec) ...)(

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


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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-27 13:18 Sven Wischnowsky [this message]
2000-06-27 15:02 ` Bart Schaefer
2000-06-27 15:06 Sven Wischnowsky
     [not found] <200006271502.RAA30019@beta.informatik.hu-berlin.de>
2000-06-27 22:46 ` Bart Schaefer
2000-06-28  7:08 Sven Wischnowsky
2000-06-29  7:02 Sven Wischnowsky
2000-06-29  9:04 ` Peter Stephenson
2000-06-29  9:27 Sven Wischnowsky

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=200006271318.PAA26871@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@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).