From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12595 invoked from network); 9 Feb 2000 18:50:58 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Feb 2000 18:50:58 -0000 Received: (qmail 1623 invoked by alias); 9 Feb 2000 18:50:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9637 Received: (qmail 1615 invoked from network); 9 Feb 2000 18:50:51 -0000 From: "Bart Schaefer" Message-Id: <1000209185039.ZM1201@candle.brasslantern.com> Date: Wed, 9 Feb 2000 18:50:39 +0000 In-Reply-To: <200002091625.RAA17482@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: file completion" (Feb 9, 5:25pm) References: <200002091625.RAA17482@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: file completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 9, 5:25pm, Sven Wischnowsky wrote: } Subject: PATCH: file completion } } I finally got fed up with those longish while-getopts loops } and added a small builtin (zparseopts) that can be used to replace } such loops. This is not a bad idea, but I repeat my frequent plea that we stop placing so much emphasis on compact syntax. nopts qopts 1opts 2opts ? It's like reading Dr. Suess. Besides, it can't support long options, which somebody at some point is going to start yelling for. How about zparseopts [ -a arraname | -A assocname | -D ] optspec ... where optspec looks like optionname["+"|":"]["="arrayname] where of course + : = in optionname can be backslashed or whatever. The -a option would mean to use that arrayname for any optspec where the =arrayname part was left off; the -A assocname would mean to set assocname[optionname] with the same semantics that getopts sets OPTARG. It could also use the GNU getopt double-colon syntax for whether an option takes a required (one colon) or optional (two colons) argument. It's also not clear what happens when there's an argument parsing error of some sort; does zparseopts just quit then and ignore the rest of the arguments, or what? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com