Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion with descriptions
- X-seq: zsh-users 10095
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: completion with descriptions
- Date: Mon, 27 Mar 2006 14:46:22 +0100
- In-reply-to: <20060327132750.GB27668@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060327132750.GB27668@xxxxxxxxx>
Andy Spiegl wrote:
> How can I provide a description for every offered completion
> like e.g. "kill" does it nicely?
>
> In my completion function I tried like this:
> ':cmds: compadd ${${(f)"$(gigaset --commands)"}%%[[:space:]]##--*}' \
You need to use the _describe function; see the zshcompsys manual.
There are examples of this buried in various places. You probably won't
be able to do it inline; you need to create an array with elements
containing both completions and descriptions separated by a colon.
Here's a noddy example.
_foo() {
local -a d
d=(foo:"The word foo" bar:"A rod")
_describe "noddy example" d
}
compdef _foo foo
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author