From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8324 invoked from network); 6 Oct 2007 12:33:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Oct 2007 12:33:46 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 79016 invoked from network); 6 Oct 2007 12:33:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Oct 2007 12:33:37 -0000 Received: (qmail 16955 invoked by alias); 6 Oct 2007 12:33:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23910 Received: (qmail 16943 invoked from network); 6 Oct 2007 12:33:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Oct 2007 12:33:34 -0000 Received: (qmail 78706 invoked from network); 6 Oct 2007 12:33:34 -0000 Received: from solo.fdn.fr (80.67.169.19) by a.mx.sunsite.dk with SMTP; 6 Oct 2007 12:33:28 -0000 Received: from localhost (reverse-66.fdn.fr [80.67.176.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: arenevier) by smtp.fdn.fr (Postfix) with ESMTP id B27AF4E8659 for ; Sat, 6 Oct 2007 14:33:27 +0200 (CEST) Date: Sat, 6 Oct 2007 14:33:27 +0200 From: arno To: zsh-workers@sunsite.dk Subject: PATCH: _init_d: handle spaces between words and pipe Message-ID: <20071006123327.GA9926@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-11) --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, _init_d completion parse init scripts to detect "case" pattern. It does not work when there are several cases, and spaces between words and= pipe=20 separator. for example, in my /etc/init.d/apache2 file, there is reload | force-reload) reload and force-reload are not part of completion suggestion If I modify that line to reload|force-reload) it works fine: reload and force-reload become part of completion suggestion= s. Here is a patch that seems to fix the problem arno. --- _init_d.old 2007-10-04 17:33:45.000000000 +0200 +++ _init_d 2007-10-06 13:52:52.000000000 +0200 @@ -15,7 +15,7 @@ what=3D'(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_st= ats)|add|delete|clean|list)' =20 read -u0 -k2 magic < $script && [[ $magic =3D '#!' ]] && - cmds=3D( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~= what}(\|${~what})#(\'|)\)}}//[^-a-z_]} ) + cmds=3D( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~= what}([[:blank:]]#\|[[:blank:]]#${~what})#(\'|)\)}}//[^-a-z_]} ) =20 # This would be the pattern to use every line of the form foo). # Some people say this might match too many lines... --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHB4CXiH9aBScBsrMRAsSGAJ95dUCgx2UkGcgb1867uWQ7bAMdbQCdH2JF ey0LjGWjFKJuvHGOR2rGdM0= =5RsA -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/--