zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Re: Saving the zle display stuff
Date: Tue, 14 Mar 2000 13:21:55 +0000	[thread overview]
Message-ID: <38CE3CF3.C8CA88A0@u.genie.co.uk> (raw)
In-Reply-To: <200003130922.KAA14988@beta.informatik.hu-berlin.de>

Sven Wischnowsky wrote:
> > > > Is there a better way for me to have done the equivalent of :*:nothing:_nothing for the -r option?
> > >
> > > Can't think of a better way... never thought about that. Hm. Is it
> > > worth to make _arguments support this directly, i.e. add a syntax
> > > saying: `no more arguments after this option'?
> >
> > There's probably quite a lot of commands like zpty where they can be
> > used in a few separate ways (each with their own set of arguments) and
> > for these commands it is useful to avoid the final arguments for some
> > forms so if it is fairly simple to do and there is a clear way of
> > representing it in the _arguments parameters then it is probably worth
> > doing.
> 
> Any suggestions for the syntax? (A trailing colon with no description
> after it?)

That would be fine.

An alternative which might be worth thinking about is to allow all lines
in _arguments to specify a list of options with which they are mutually
exclusive. So in the vase of _zpty, I would use:
  '(-r)*::args:_normal'
as the last line.

I think this might be more useful. For example consider the case of
AIX's lsvg command for which I recently wrote a completion function.
It's syntax is of the following form:

Usage: lsvg [-o] [-n PVname]
       lsvg [-i] [-M|-l|-p] VGname...

So basically it has two different forms. The trouble is that I can't use
my _nothing trick for -o or -n because I might want to complete a -n
option after a -o option or vice-versa. It worked for zpty's -r option
because -r can only be used on its own. What I would like to do for lsvg
is to use something like:
  '(-o -n)*:volume groups:_volume_groups'
for the last line.

I seem to have some fairly long option exclusion lists in some of my
completions so it might also be worth thinking if there are any better
ways of doing the completion when there are separate forms of the
command. I experimented with a few things like using two calls to
_arguments without much success.

Oliver


  reply	other threads:[~2000-03-14 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-13  9:22 Sven Wischnowsky
2000-03-14 13:21 ` Oliver Kiddle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-03-14  9:38 Sven Wischnowsky
2000-03-09 14:45 Sven Wischnowsky
2000-03-10 16:47 ` Oliver Kiddle
2000-03-09 12:52 Oliver Kiddle

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=38CE3CF3.C8CA88A0@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --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).