From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11308 invoked from network); 19 Nov 2003 17:19:10 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Nov 2003 17:19:10 -0000 Received: (qmail 5766 invoked by alias); 19 Nov 2003 17:18:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19259 Received: (qmail 5726 invoked from network); 19 Nov 2003 17:18:58 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 19 Nov 2003 17:18:58 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.33.218.17] by sunsite.dk (MessageWall 1.0.8) with SMTP; 19 Nov 2003 17:18:57 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id hAJHIul11249 for zsh-workers@sunsite.dk; Wed, 19 Nov 2003 09:18:56 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1031119171855.ZM11248@candle.brasslantern.com> Date: Wed, 19 Nov 2003 17:18:55 +0000 In-Reply-To: <29608.1069237406@gmcs3.local> Comments: In reply to Oliver Kiddle "Re: Completion function for bitkeeper?" (Nov 19, 11:23am) References: <20031106153225.GA491@lorien.emufarm.org> <1281.1068232665@athlon> <20031110182013.GA20547@lorien.emufarm.org> <9219.1068538977@gmcs3.local> <20031111162338.GD23138@lorien.emufarm.org> <901.1068577572@athlon> <20031111212828.GA28125@lorien.emufarm.org> <29114.1068797096@gmcs3.local> <20031114154608.GA6959@lorien.emufarm.org> <15744.1069084060@gmcs3.local> <20031117175151.GA24060@lorien.emufarm.org> <29608.1069237406@gmcs3.local> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: compadd option passing (Re: Completion function for bitkeeper?) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii [redirected to zsh-workers] On Nov 19, 11:23am, Oliver Kiddle wrote: } } I agree that it isn't ideal. The best alternative I can think of would } be to pass compadd options to the various tag handling functions } instead of the completion functions. That makes it harder for people writing simple completion functions to make use of the compadd options, though. Maybe that never comes up, but it seems an unnecessary limitation. I suggest instead that we choose a single option (or other syntactic marker) that is documented as being passed to completion functions to delimit the compadd options from the any options of the function itself. E.g. soemthing like "everything between -o and a bare '-' is a compadd option": completion_func ... -o compadd options here - ... That specific suggestion probably won't work because a hyphen may appear as an argument to -S or -P or -r etc., but you get the idea. Alternately always pass the compadd options in an array parameter, and use such a "reserved option" of completion_func to specify the name of that parameter: compaddopts=( ... ) completion_func ... -o compaddopts ... In either of the above scenarios, completion functions can avoid name clashes by extracting the -o option with zparseopts and storing the resuting array in a local before declaring any other locals whose names might conflict. The docs could include sample code for this that could be cut'n'pasted into new completion functions.