zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Update _virsh completion
Date: Thu, 1 Sep 2016 16:01:35 +0000	[thread overview]
Message-ID: <20160901160135.GA5339@fujitsu.shahaf.local2> (raw)
In-Reply-To: <14008.1472679881@hydra.kiddle.eu>

Oliver Kiddle wrote on Wed, Aug 31, 2016 at 23:44:41 +0200:
> Daniel Shahaf wrote:
> > Marko Myllynen wrote on Mon, Aug 29, 2016 at 11:03:13 +0300:
> > > $ virsh start --domain foo --autodestroy <TAB>
> > > --autodestroy   --console       --pass-fds                                  
> >
> > That's because the expansion contains "--autodestroy" twice.  You can
> > easily uniquify the expansion with ${(u)foo} (or 'typeset -aU').
> 
> I think it is caused by the presence of the word foo on the
> line which is not one of the values passed to _values.

I can't reproduce the problem you're describing here.

I can reproduce the problem I described in my previous reply:

$ zsh -f
% autoload compinit; compinit
% _f() _values -w desc foo bar baz foo 
% compdef _f f
% f foo bar <TAB>
baz  foo

> The description describes what should be entered (e.g. a server) not
> what the listed matches are (e.g.  servers).

To clarify: the description tells the user how the shown values would be
used.  This is easiest to explain in terms of commands that takes
multiple arguments of the same type, like 'mv foo.txt bar.txt' might use
the descriptions "source file" and "target file".

(The example ignores some other syntaxes of mv(1) for simplicity.)

Cheers,

Daniel


  reply	other threads:[~2016-09-01 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29  8:03 Marko Myllynen
2016-08-31 17:49 ` Daniel Shahaf
2016-08-31 21:44   ` Oliver Kiddle
2016-09-01 16:01     ` Daniel Shahaf [this message]
2016-09-02  9:36   ` Marko Myllynen
2016-09-02 18:20     ` Daniel Shahaf
2016-09-04 18:26       ` Daniel Shahaf
2016-09-05  6:29       ` Marko Myllynen

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=20160901160135.GA5339@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /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).