zsh-users
 help / color / mirror / code / Atom feed
* Re: (forw) --help able programs and completion
@ 2000-06-26 10:45 Sven Wischnowsky
  0 siblings, 0 replies; 40+ messages in thread
From: Sven Wischnowsky @ 2000-06-26 10:45 UTC (permalink / raw)
  To: zsh-users


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


^ permalink raw reply	[flat|nested] 40+ messages in thread
* (forw) --help able programs and completion
@ 2000-06-26 10:14 Roland Jesse
  2000-06-26 10:20 ` Peter Stephenson
  0 siblings, 1 reply; 40+ messages in thread
From: Roland Jesse @ 2000-06-26 10:14 UTC (permalink / raw)
  To: Zsh Users

----- Forwarded message from Matthias Kopfermann <kopfermann@trio-hittfeld.de> -----

Date: Mon, 26 Jun 2000 12:13:15 +0200
From: Matthias Kopfermann <kopfermann@trio-hittfeld.de>
To: Bart Schaefer <schaefer@candle.brasslantern.com>
Cc: Roland Jesse <jesse@prinz.cs.uni-magdeburg.de>
Subject: --help able programs and completion
X-Mailer: Mutt 1.0i

Hi all,

I would like to have _all_ programs that have `--help'
to be completed with the right "--words".

Any idea how i could achieve that?

Of course i don't want to let the already existing completion
system for many programs to be overridden.
Only if there is _no_ completion there should ZSH  take the --help
approach.

Ps: this new completion system could be a big win if it had 
easy to understand dialog-like boxes which one could use to
choose styles and tags and so on. :)
 At least for me it is much too difficult in the present state.
 I know that i can do almost anything with it but it still takes
 a lot of my time to understand it. :(

 --
 Unix is not _beginners_ friedly, thats the problem. No reason
 for a joke here.

----- End forwarded message -----


^ permalink raw reply	[flat|nested] 40+ messages in thread
* Re: wish for a colored completion system
@ 2000-06-08 10:41 Sven Wischnowsky
  0 siblings, 0 replies; 40+ messages in thread
From: Sven Wischnowsky @ 2000-06-08 10:41 UTC (permalink / raw)
  To: zsh-users


Bart Schaefer wrote:

> ...
> 
> So for example one can do
> 
> zstyle ':completion:*:zsh-options' \
> 	list-colors '=csh*=31:=*hist*=32:=list*=34:=*glob*=35'
> 
> ...
> 
> The tricky bit is figuring out what string goes at the tail of the style
> pattern, e.g. `zsh-options' in this case.  The place to look is the
> "Standard Tags" subsection in the "Completion System Configuration"
> chapter.

Or hit ^Xh (control-x h) and it will tell you (the `tags').


Bye
 Sven


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


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2000-08-02 19:12 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <no.id>
2000-06-08 14:31 ` wish for a colored completion system Matthias Kopfermann
2000-06-08 14:49   ` Sven Wischnowsky
2000-06-08 14:50   ` Thomas Köhler
2000-06-08 15:11     ` Matthias Kopfermann
2000-06-08 15:32       ` have to get used to the new zstyle thingy! Matthias Kopfermann
     [not found]         ` <0FVU005MNF7Q6N@la-la.cambridgesiliconradio.com>
2000-06-08 17:37           ` wish for a colored completion system Bart Schaefer
2000-06-08 18:44             ` Fletch
     [not found]               ` <000608122524.ZM16857@candle.brasslantern.com>
     [not found]                 ` <m2bt1c0xoe.fsf@godzilla.phydeaux.org>
2000-06-08 20:07                   ` Bart Schaefer
2000-06-08 20:18                     ` Fletch
2000-06-08 20:36                       ` Peter Stephenson
2000-06-09 13:36 ` Matthias Kopfermann
2000-06-14 13:43 ` Fun zsh trick for today Matthias Kopfermann
2000-06-14 13:57   ` Clint Adams
2000-06-14 14:09     ` Ollivier Robert
2000-06-14 15:02       ` Fletch
2000-06-14 14:15     ` Peter Stephenson
2000-06-14 14:21       ` Peter Stephenson
2000-06-14 14:27       ` Clint Adams
2000-06-14 14:37       ` Bart Schaefer
2000-06-14 15:33 ` Matthias Kopfermann
2000-06-14 15:52   ` Peter Stephenson
2000-06-14 16:31 ` Matthias Kopfermann
2000-06-26 10:23 ` (forw) --help able programs and completion Matthias Kopfermann
2000-06-26 10:30 ` Matthias Kopfermann
2000-06-29 11:41 ` is the reference card for zsh still 3.0 ? Matthias Kopfermann
2000-07-05 10:47 ` Matthias Kopfermann: Re: coloring of --help completion possible? Matthias Kopfermann
2000-07-17 13:39 ` wanted: viins-mode and digit argument with a,i,A and such Matthias Kopfermann
2000-07-17 14:06   ` Peter Stephenson
2000-07-21 10:42 ` completion for GNU color ls, anyone? Matthias Kopfermann
2000-07-21 15:17   ` Adam Spiers
2000-07-21 10:58 ` Matthias Kopfermann
2000-07-21 15:54   ` Bart Schaefer
2000-07-21 16:00 ` Matthias Kopfermann
2000-07-26 16:24 ` how can one let completion work *inside* zsh scripts? Matthias Kopfermann
2000-07-27 12:42 ` Matthias Kopfermann
2000-08-01 15:34 ` Matthias Kopfermann
2000-06-26 10:45 (forw) --help able programs and completion Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-06-26 10:14 Roland Jesse
2000-06-26 10:20 ` Peter Stephenson
2000-06-08 10:41 wish for a colored completion system Sven Wischnowsky

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).