Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completing multiple states with _arguments
- X-seq: zsh-users 15530
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- Subject: Re: Completing multiple states with _arguments
- Date: Wed, 10 Nov 2010 12:23:50 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=b9PWkrnnxGh3GusEQ0ZsHCQIhMNz3UzPatcZwoOKw60=; b=Zwx910q7Qz3JQit3f44VdJLIqpAOzlcdoPhFeK2RLziMdU4zXo5bpt2WOhIaEwTOk+ BLYhQLoFpBrPQOXkyuZlQ8rO5RNjCrai0DB4MkjSYyF3Ku+C4hOQkcDlFxuds+ByWNTR joIp277CvGgz/jmsAd8zC2MVod/IgdCoB2r3s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=jwC7bSA+WhZx0W6nsqg/Pbk29Pmx6b0dv9J3U8JwNv6ZDMuxw+1NNUuzN7zofqmQsb 4kOlpFNYIWR+/lZHAoxU8cDvMdpa0nmCzBV4Ev8SjZ4Jh2ZiwdWfapoELMLepPepbXdi 5DcjeI8FHI0abKJLSt/VtcFAvEOpgGFagCfPI=
- In-reply-to: <20101110102034.679387f9@xxxxxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTintH3mBrt+_csUYuJX8FM76_j6AhPXjoXCU2WXP@xxxxxxxxxxxxxx> <20101110102034.679387f9@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On Wed, Nov 10, 2010 at 11:20, Peter Stephenson
<Peter.Stephenson@xxxxxxx> wrote:
> On Tue, 9 Nov 2010 23:49:41 +0100
> Nikolai Weibull <now@xxxxxxxx> wrote:
>> How do I deal with multiple states when completing with _arguments?
>>
>> local context state line
>> typeset -A opt_args
>>
>> _arguments \
>> Â ':: :->something-optional-before-files' \
>> Â '*:: :->file' && ret=0
>>
>> # Now what?
>
> Usually you would use "case $state ... esac" to handle the states, with
> matches against something-optional-before-files, file, etc. ÂThere are
> quite a few uses of this if you search for $state in completion.
No, no, $state is (something-optional-before-files file) in this case.
Is it as simple as
local s
for s in $state; do
case $s in â esac
done
or do you need to deal with tags and such through _alternative or so?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author