From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3054 invoked from network); 28 Oct 2005 17:12:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Oct 2005 17:12:39 -0000 Received: (qmail 55268 invoked from network); 28 Oct 2005 17:12:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Oct 2005 17:12:31 -0000 Received: (qmail 25541 invoked by alias); 28 Oct 2005 17:12:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9586 Received: (qmail 25530 invoked from network); 28 Oct 2005 17:12:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Oct 2005 17:12:24 -0000 Received: (qmail 54349 invoked from network); 28 Oct 2005 17:12:24 -0000 Received: from webmail.ageia.com (HELO spectre.ageia.com) (199.217.242.236) by a.mx.sunsite.dk with SMTP; 28 Oct 2005 17:12:23 -0000 Received: from [192.168.0.10] ([10.15.0.28]) by spectre.ageia.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 28 Oct 2005 12:12:20 -0500 From: Steve Borho Organization: Ageia Technologies, Inc To: zsh-users@sunsite.dk Subject: safe completion functions Date: Fri, 28 Oct 2005 12:14:38 -0500 User-Agent: KMail/1.8.92 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1770903.GGkl5ziAPk"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200510281214.42804.steve@borho.org> X-OriginalArrivalTime: 28 Oct 2005 17:12:20.0642 (UTC) FILETIME=[C18F6820:01C5DBE2] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 --nextPart1770903.GGkl5ziAPk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello everyone. I'm trying to write a somewhat feature-full completion function for the new= =20 bazaar 2.0 (aka bzr) revision control system. The bzr developers have recently added some command line functions that can= =20 list files with NULL terminators, just like find. Unfortunately, I can't g= et=20 the completion functions to work correctly. my completion function for add looks like this (in a nutshell): (add) _arguments $helpArgs \ '--no-recurse[do not recurse into subdirectories]' \ '(-q)--quiet' \ '(--quiet)-q' \ '*:unknown files:_unknownFiles' ;; _unknownFiles() { local fileList; fileList=3D($(bzr ls --null --unknown)) compadd -af fileList return 0 } When I test it, I get: this % cd repo % touch "foo bar" baz zed % bzr add [TAB] bar baz foo zed It's somehow splitting "foo\ bar" into "foo", " ", "bar". I seem to be=20 missing something obvious. Can anyone help? =2D-=20 Steve Borho (steve@borho.org) http://www.borho.org/~steve/steve.asc Key fingerprint =3D 2D08 E7CF B624 624C DE1F E2E4 B0C2 5292 F2C6 2C8C --nextPart1770903.GGkl5ziAPk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBDYlyCsMJSkvLGLIwRAoQYAKCU6YmmfybmOiqe+iZKAlUeaYpK5QCfRmp1 Nkdf5kK7/INliKJ9V9w0nkc= =nnZu -----END PGP SIGNATURE----- --nextPart1770903.GGkl5ziAPk--