Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Update _virsh completion

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



Messages sorted by: Reverse Date, Date, Thread, Author