Zsh Mailing List Archive
Messages sorted by:
Re: using the description from _arguments foo:description:->state
- X-seq: zsh-workers 29790
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: using the description from _arguments foo:description:->state
- Date: Wed, 21 Sep 2011 13:39:07 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1316605148; bh=TBfksGsB4gtfsRw5rl/PmfVzjDOQ69svIT2LNKRI7SM=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=rbnY85EhQgIxUxmLwDqwA89fh4hZTl1K52KV1Ca+BO6i9pgvZ1gxNDgZ06Gd8gDGKMCODMTviwN9PyRElEl0T8LIiaq+v5sQsjLCN+0y8Ld/39rIKui3JumoOxpUcxl52eD81vQ+WpUw6fB4AGjizUeh+Cu1CdH9slWVVJturiM=
- In-reply-to: <CAHYJk3RSc0bEApiyP5+=7Sm443iemHwDb4mQ_3OfGj5vR1ivAQ@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3RA-o47Lwtv-5tGgzQnKz1voKz93bGvLuZdgT07hacSng@mail.gmail.com> <110911111050.ZM11625@torch.brasslantern.com> <CAHYJk3RSc0bEApiyP5+=7Sm443iemHwDb4mQ_3OfGj5vR1ivAQ@mail.gmail.com>
Mikael Magnusson wrote:
> On 11 September 2011 20:10, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> > } "($opts)-A[define widget alias]:old widget:->widget :new
> Can we add a new option to _configure which enables this, so if you
> say _arguments -d you also have to local state_descr. There's a couple
> of other variables that work like this already, -n for NORMARG, -C for
While we could, there's always the possibility that some function
somewhere has a -d that's intended to me an argument to be completed.
If you used a function instead of a state, it would be called with the
relevant arguments for the description unless you prefix it with a space
in which case, you'd have to dig around in $expl. Perhaps we could use
some similar syntax to the space prefix instead of an option.
Unless you pass -C to _arguments there is the possibility of more than
one state being possible so any state_descr would need to be an array.
And we can't do arrays of arrays so a state_expl wouldn't be possible
(expl is already an array). That would put me off the whole idea somewhat.
Personally, I'd be inclined to have a separate new-widget state in this
particular function. Alternatively, you could use the value of $context
to get the right description or use a function for completing widgets.
Messages sorted by: