From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14590 invoked from network); 24 Feb 1997 20:01:44 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 24 Feb 1997 20:01:44 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA10402; Mon, 24 Feb 1997 14:54:46 -0500 (EST) Resent-Date: Mon, 24 Feb 1997 14:42:34 -0500 (EST) Date: Mon, 24 Feb 1997 09:33:09 -0700 From: John Harres Subject: grouping in patterns in extended compctl To: zsh-users@math.gatech.edu Message-id: <199702241633.JAA02090@horseman.uwyo.edu> MIME-version: 1.0 X-Mailer: exmh version 2.0gamma 1/27/96 Content-type: multipart/signed; boundary="==_Exmh_415440927087P"; micalg=pgp-md5; protocol="application/pgp-signature" Content-transfer-encoding: 7bit X-Url: http://horseman.uwyo.edu/~harres X-Authentication-warning: horseman.uwyo.edu: localhost [127.0.0.1] didn't use HELO protocol X-MTS: smtp Resent-Message-ID: <"wGiDs3.0.oO2.byU4p"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/709 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu --==_Exmh_415440927087P Content-Type: text/plain; charset=us-ascii I'm trying to build completion control for a rather complicated command, and have run into a snag trying to override the default precedence in the pattern specification for extended completion (what a sentence!). Here's what I have so far: dbobj=(cycle cyclev device file finss gidmap history host job license location m ediatype osref pool poolacl rack saveacl saveset slot uidmap volacl volalias vol ume wo woparam xgid xuid) volparams=(volid volname ansil side flipid nxtid gid uid hostid purdate cerdate cleandate cleancnt initdate accdate mountcnt expdate length capacity slotid onda te nxtlocid offdate cyclevid devid casel barcode mode protection brand density n ote locid mediatypes poolid volstate statedate cycleid cyclename cycv_seq device flipansil flipvolname host location mediatype nxtansil nxtlocation nxtvolname p ool prvansil prvid prvvolname rackname rackid slotname) compctl -k '(add delete modify query)' \ -x 'c[-1,add][-1,delete][-1,modify][-1,query]' -k dbobj - \ 'c[-2,add][-2,delete][-2,modify][-2,query] c[-1,volume] s[-] , s[-m_]' -k volparams -- sc Unfortunately, what need to do with the second pattern set is say: if two words ago was one of 'add delete modify, or query', and one word ago was 'volume' and the current word starts with - or -m_, then match with any of the volparams array. Unfortunately, the default precedence appears to and the c[-1,volume] and s[-] before the or'ing of s[-] , s[-m_]. Suggestions? Also, any suggestions on cleaning this up in general would be appreciated. This could end up being one of the longest compctl's ever built! Which brings up another question: what's the max length of one of these? John -- John Harres http://horseman.uwyo.edu/~harres University of Wyoming Finger harres@horseman.uwyo.edu for PGP public key. Key fingerprint = FC B4 72 D6 37 A7 A1 73 BE 8B F3 E2 99 68 BF 5A --==_Exmh_415440927087P Content-Type: application/pgp-signature -----BEGIN PGP MESSAGE----- Version: 2.6.2 iQB1AwUBMxHCxAxlFYvtP/ENAQHJOwMAmUPwqXYVGGlKqrRgCAjAfeSyOpZ7oJ8a wOk8oYb+ZZu+K+ots4QUwxSlzzTD82MDcns5sIHT4E668T+fCIl5R+PaFtl49pIj IiZmby+dE+LsFQsNzp1ag1DPb1+QF9y8 =xGcx -----END PGP MESSAGE----- --==_Exmh_415440927087P-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14628 invoked from network); 24 Feb 1997 20:22:24 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 24 Feb 1997 20:22:24 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA11620; Mon, 24 Feb 1997 15:16:57 -0500 (EST) Resent-Date: Mon, 24 Feb 1997 15:10:01 -0500 (EST) From: Zefram Message-Id: <21287.199702242011@stone.dcs.warwick.ac.uk> Subject: Re: grouping in patterns in extended compctl To: Harres@UWyo.Edu (John Harres) Date: Mon, 24 Feb 1997 20:11:33 +0000 (GMT) Cc: zsh-users@math.gatech.edu In-Reply-To: <199702241633.JAA02090@horseman.uwyo.edu> from "John Harres" at Feb 24, 97 09:33:09 am X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8934.20 X-Phase: The Moon is Waning Gibbous (95% of Full) X-US-Congress: Moronic fuckers X-Personality: INTJ Content-Type: text Resent-Message-ID: <"xtBB53.0.lm2.KMV4p"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/710 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu John Harres wrote: > 'c[-2,add][-2,delete][-2,modify][-2,query] c[-1,volume] s[-] , s[-m_]' -k volparams -- sc > >Unfortunately, what need to do with the second pattern set is say: > >if two words ago was one of 'add delete modify, or query', and one word ago >was 'volume' and the current word starts with - or -m_, then match with any >of the volparams array. Unfortunately, the default precedence appears to and >the c[-1,volume] and s[-] before the or'ing of s[-] , s[-m_]. Suggestions? You could repeat the "c[-2,...] c[-1,volume]" part after the comma. >This could end up being one of the longest compctl's ever built! Have you looked at the gcc compctl in Misc/compctl-examples? > Which brings >up another question: what's the max length of one of these? How much memory do you have? -zefram From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14908 invoked from network); 24 Feb 1997 23:27:46 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 24 Feb 1997 23:27:46 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA17869; Mon, 24 Feb 1997 18:22:46 -0500 (EST) Resent-Date: Mon, 24 Feb 1997 18:11:49 -0500 (EST) Date: Mon, 24 Feb 1997 13:31:28 -0700 From: John Harres Subject: Re: grouping in patterns in extended compctl In-reply-to: "Your message of Mon, 24 Feb 97 20:11:33 GMT." <21287.199702242011@stone.dcs.warwick.ac.uk> To: Zefram Cc: zsh-users@math.gatech.edu Message-id: <199702242031.NAA26691@horseman.uwyo.edu> MIME-version: 1.0 X-Mailer: exmh version 2.0gamma 1/27/96 Content-type: multipart/signed; boundary="==_Exmh_416127526104P"; micalg=pgp-md5; protocol="application/pgp-signature" Content-transfer-encoding: 7bit X-Url: http://horseman.uwyo.edu/~harres X-Authentication-warning: horseman.uwyo.edu: localhost [127.0.0.1] didn't use HELO protocol X-MTS: smtp Resent-Message-ID: <"Lbewr1.0.WH4.q0Y4p"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/711 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu --==_Exmh_416127526104P Content-Type: text/plain; charset=us-ascii On Mon 24 Feb 97, zefram@dcs.warwick.ac.uk wrote: > John Harres wrote: > > 'c[-2,add][-2,delete][-2,modify][-2,query] c[-1,volume] s[-] , s[-m_]' -k > volparams -- sc > > > > You could repeat the "c[-2,...] c[-1,volume]" part after the comma. After some refinement, that line is now: 'w[1,add][1,delete][1,modify][1,query] w[2,volume] s[-] , w[1,add][1,delete][1,modify][1,query] w[2,volume] s[-m_]' -k volparams - which doesn't seem to work for the -m_ stuff. I was just hoping that there was an easier way of handling this, since this is just the first one for the array. dbobj=(cycle cyclev device file finss gidmap history host job license location m ediatype osref pool poolacl rack saveacl saveset slot uidmap volacl volalias vol ume wo woparam xgid xuid) > > >This could end up being one of the longest compctl's ever built! > > Have you looked at the gcc compctl in Misc/compctl-examples? Yes, I have, and I still stand by my statement. This program was originally written by some VMS people who converted it to UNIX, thus it's quite verbose in its options. Thanks for the help. Any ideas why the -m_ doesn't work? Maybe because the previous s[-] is a prefix of [-m_] ? Workarounds? John -- John Harres http://horseman.uwyo.edu/~harres University of Wyoming Finger harres@horseman.uwyo.edu for PGP public key. Key fingerprint = FC B4 72 D6 37 A7 A1 73 BE 8B F3 E2 99 68 BF 5A --==_Exmh_416127526104P Content-Type: application/pgp-signature -----BEGIN PGP MESSAGE----- Version: 2.6.2 iQB1AwUBMxH6nwxlFYvtP/ENAQGSCQL7Bsix1/4GY2LszN2EcXILcuVPyr3ktQ/8 vZNKOyxHYs1Rmg2cHzcu+XHuDXgLn+NJEqd9TIOzE40PLHw5RBHX16kOlU4f28TD AG68Ga+yFEPxJHEYqjr/45ERcjBd64l+ =zZKA -----END PGP MESSAGE----- --==_Exmh_416127526104P-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14955 invoked from network); 24 Feb 1997 23:59:57 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 24 Feb 1997 23:59:57 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA19023; Mon, 24 Feb 1997 18:55:03 -0500 (EST) Resent-Date: Mon, 24 Feb 1997 18:41:08 -0500 (EST) From: Zefram Message-Id: <20868.199702242343@stone.dcs.warwick.ac.uk> Subject: Re: grouping in patterns in extended compctl To: Harres@UWyo.Edu (John Harres) Date: Mon, 24 Feb 1997 23:43:11 +0000 (GMT) Cc: zefram@dcs.warwick.ac.uk, zsh-users@math.gatech.edu In-Reply-To: <199702242031.NAA26691@horseman.uwyo.edu> from "John Harres" at Feb 24, 97 01:31:28 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8934.94 X-Phase: The Moon is Waning Gibbous (95% of Full) X-US-Congress: Moronic fuckers X-Personality: INTJ Content-Type: text Resent-Message-ID: <"ho5Ve.0.yZ4.KSY4p"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/712 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu John Harres wrote: >Thanks for the help. Any ideas why the -m_ doesn't work? Maybe because the >previous s[-] is a prefix of [-m_] ? Workarounds? Yes. Put the -m_ one first. -zefram