From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16879 invoked by alias); 10 Nov 2010 12:38:09 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15532 Received: (qmail 18327 invoked from network); 10 Nov 2010 12:37:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.171 as permitted sender) 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= MIME-Version: 1.0 Sender: nikolai.weibull@gmail.com In-Reply-To: <20101110121107.3303c6c5@pwslap01u.europe.root.pri> References: <20101110102034.679387f9@pwslap01u.europe.root.pri> <20101110121107.3303c6c5@pwslap01u.europe.root.pri> Date: Wed, 10 Nov 2010 13:37:54 +0100 X-Google-Sender-Auth: lbRdG-saet46rfBS_4dSBF-wJbQ Message-ID: Subject: Re: Completing multiple states with _arguments From: Nikolai Weibull To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 10, 2010 at 13:11, Peter Stephenson wrote: > On Wed, 10 Nov 2010 12:23:50 +0100 > Nikolai Weibull wrote: >> >> local context state line >> >> typeset -A opt_args >> >> >> >> _arguments \ >> >> =C2=A0 ':: :->something-optional-before-files' \ >> >> =C2=A0 '*:: :->file' && ret=3D0 >> >> >> >> # Now what? >> >> Is it as simple as >> >> local s >> for s in $state; do >> =C2=A0 case $s in =E2=80=A6 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. =C2=A0However, that should all be standard: loopin= g > over the states is fine, then use the usual _wanted stuff inside the > case and the tags get sorted out automatically, in principle. =C2=A0There= '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=E2=80=99ll report my findings.