From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2501 invoked from network); 14 Feb 2004 20:09:43 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Feb 2004 20:09:43 -0000 Received: (qmail 8051 invoked by alias); 14 Feb 2004 20:09:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7056 Received: (qmail 8037 invoked from network); 14 Feb 2004 20:09:24 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 14 Feb 2004 20:09:24 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [66.111.4.25] by sunsite.dk (MessageWall 1.0.8) with SMTP; 14 Feb 2004 20:9:23 -0000 Received: from frontend3.messagingengine.com (frontend3.internal [10.202.2.152]) by mail.messagingengine.com (Postfix) with ESMTP id 8D9AE50F6C8 for ; Sat, 14 Feb 2004 15:09:21 -0500 (EST) Received: by frontend3.messagingengine.com (Postfix, from userid 99) id 89E192C; Sat, 14 Feb 2004 15:09:22 -0500 (EST) Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.2 (F2.72; T1.001; A1.60; B2.21; Q2.21) From: "Dwight Shih" To: "Zsh users list" Date: Sat, 14 Feb 2004 15:09:22 -0500 X-Sasl-Enc: xM8MExuTURJ5gDK/FUJWFA 1076789362 Message-Id: <1076789362.2984.181046220@webmail.messagingengine.com> Subject: completion help References: ARRAY(0xa175c60) In-Reply-To: ARRAY(0xa0b208c) After years of avoidance, I've finally decided to start playing with completion. Here's what I've got: typeset -A opt_args local contest state line _arguments -s -S \ "1:build:(build test start stop deploy validate help)" \ "*:file:_files" \ "-conf[specify configuration file]:file:_files" \ "-a[automate deploy actions]" \ "-f[force more or copy]" \ "-m[move jar]" \ "-c[copy jar]" \ "-v(vv vvv)[validate output level 1]" \ "-vv(v vvv)[validate output level 2]" \ "-vvv(v vv)[validate output level 3]" \ && return 0 which works as far as it goes. What I would like to group options by major mode (the first set of mutually exclusive options: build test start stop deploy validate and help) so that only valid options for each mode would apply. So -a -f -m -c would only apply in the deploy mode and -v -vv -vvv would only apply in the validate mode. I'd also like to restrict file completions. For example, I would like to restrict the -conf file completion to be limited to *.xml and the general file completion to be limited to *.jar. Thanks for any help that you can provide. Dwight Shih