zsh-users
 help / color / mirror / code / Atom feed
* (forw) --help able programs and completion
@ 2000-06-26 10:14 Roland Jesse
  2000-06-26 10:20 ` Peter Stephenson
  0 siblings, 1 reply; 5+ 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] 5+ messages in thread

* Re: (forw) --help able programs and completion
  2000-06-26 10:14 (forw) --help able programs and completion Roland Jesse
@ 2000-06-26 10:20 ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-06-26 10:20 UTC (permalink / raw)
  To: Zsh users list

not quite sure who's forwarding what to whom here...
> 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. :(

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.

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: (forw) --help able programs and completion
@ 2000-06-26 10:45 Sven Wischnowsky
  0 siblings, 0 replies; 5+ 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] 5+ messages in thread

* Re: (forw) --help able programs and completion
       [not found] <no.id>
  2000-06-26 10:23 ` Matthias Kopfermann
@ 2000-06-26 10:30 ` Matthias Kopfermann
  1 sibling, 0 replies; 5+ messages in thread
From: Matthias Kopfermann @ 2000-06-26 10:30 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh users list

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?

-- 
And in the end the love you take 
is equal to the love you make
THE BEATLES


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

* Re: (forw) --help able programs and completion
       [not found] <no.id>
@ 2000-06-26 10:23 ` Matthias Kopfermann
  2000-06-26 10:30 ` Matthias Kopfermann
  1 sibling, 0 replies; 5+ messages in thread
From: Matthias Kopfermann @ 2000-06-26 10:23 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh users list

On Mon, Jun 26, 2000 at 11:20:20AM +0100, Peter Stephenson wrote:
> not quite sure who's forwarding what to whom here...
I am sorry, I was blind so I made the mistake of sending to the
wrong address :)

Matthias


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

end of thread, other threads:[~2000-06-26 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-26 10:14 (forw) --help able programs and completion Roland Jesse
2000-06-26 10:20 ` Peter Stephenson
     [not found] <no.id>
2000-06-26 10:23 ` Matthias Kopfermann
2000-06-26 10:30 ` Matthias Kopfermann
2000-06-26 10:45 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).