Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completing multiple states with _arguments
- X-seq: zsh-users 15532
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- Subject: Re: Completing multiple states with _arguments
- Date: Wed, 10 Nov 2010 13:37:54 +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=pX0lEecyvRv9G9WajJHk4RqrbBEqim0lG2lKRG7UYgE=; b=gF5Z60XXkK5EkyP+8a/OcxyNTI7aqKLJzpxTWAcvdeZwvttz+Sv1n/51vXBBYO1wzO 3V5F0AUn0HesfEGOo92iJQBJFBaFdHSeGJp8LWM6mA9AcaLIBlu4rtQvzhIxIfMACEe/ Cr+TWiRj9pVl3PDwasC2qWQqF5isxhYV1Anj4=
- 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=FLXgHgztRHp4TvC/IyiSQtwIgQYbTrUWazz0JbA9YEMf5tMCNN0TkP2l1uXSExrWq1 c79bv/DRTu84zFWeJcsrnGWJLbdCSQcvLdEHSQ0uiRWIOTJUVmQ5GoU5UjO4TNev5HnL Yc9v08jrpdSKVJDUEIxEfgMCffJnAfsPAk/dM=
- In-reply-to: <20101110121107.3303c6c5@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> <AANLkTimr25=Yab5DHRHg+SOPioh-C6byZ+ieGr+KmtPA@xxxxxxxxxxxxxx> <20101110121107.3303c6c5@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On Wed, Nov 10, 2010 at 13:11, Peter Stephenson
<Peter.Stephenson@xxxxxxx> wrote:
> On Wed, 10 Nov 2010 12:23:50 +0100
> Nikolai Weibull <now@xxxxxxxx> wrote:
>> >> local context state line
>> >> typeset -A opt_args
>> >>
>> >> _arguments \
>> >> Â ':: :->something-optional-before-files' \
>> >> Â '*:: :->file' && ret=0
>> >>
>> >> # Now what?
>>
>> 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?
>
> I think you do need to set up tags here, at least most scripts do and I
> haven't tried without. ÂHowever, that should all be standard: looping
> over the states is fine, then use the usual _wanted stuff inside the
> case and the tags get sorted out automatically, in principle. ÂThere's
> nothing to stop you using _alternative, either.
>
> In short, just adding the loop over the state to the sort of stuff that
> usually appears in the "case" here should be OK.
OK, thank you. Iâll report my findings.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author