From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17265 invoked from network); 15 Oct 2003 09:52:07 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Oct 2003 09:52:07 -0000 Received: (qmail 23050 invoked by alias); 15 Oct 2003 09:51:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6706 Received: (qmail 23020 invoked from network); 15 Oct 2003 09:51:03 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 15 Oct 2003 09:51:03 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.193.203.32] by sunsite.dk (MessageWall 1.0.8) with SMTP; 15 Oct 2003 9:51:0 -0000 Received: from DervishD.pleyades.net (212.Red-80-35-44.pooles.rima-tde.net [80.35.44.212]) by madrid10.amenworld.com (8.10.2/8.10.2) with ESMTP id h9F9olD07450; Wed, 15 Oct 2003 11:50:49 +0200 Received: from raul@pleyades.net by DervishD.pleyades.net with local (Exim MTA 2.05) id <1A9i5t-0000IK-00>; Wed, 15 Oct 2003 11:37:25 +0200 Date: Wed, 15 Oct 2003 11:37:25 +0200 From: DervishD To: Bart Schaefer Cc: Zsh Users Subject: Re: compctl -l Message-ID: <20031015093725.GM867@DervishD> Mail-Followup-To: Bart Schaefer , Zsh Users References: <20031014230217.GB867@DervishD> <1031015051338.ZM23147@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1031015051338.ZM23147@candle.brasslantern.com> User-Agent: Mutt/1.4i Organization: Pleyades User-Agent: Mutt/1.4i Hi Bart :)) Definitely, if you ever come to Spain, I owe you a good dinner ;)) * Bart Schaefer dixit: > } I'm trying to learn now the old completion code (compctl), but > } I'm clueless with option '-l'. > Have you looked at Misc/compctl-examples yet? Yes, I've read them, although I've not tried to understand all of them, since I've not read all the -x completion yet. > "compctl -l foo bar" means that, if there exists a compctl for "foo", > then use that when completing arguments of "bar". It's like aliasing. > If there is not a compctl for "foo", it's useless. Yes, this one was the first I got, because the examples are more or less clear and my own experiments led me to this conclussion. > "compctl -l '' bar" means that "bar" should be ignored for purposes of > completion; that is, the first word after "bar" completes as a command, > and the second and further words complete as arguments of the command > named by the first word. The classic example is > compctl -l '' nohup noglob exec nice eval - time rusage Yes, this is another clear use I understood. The '-' doesn't confuse compctl? > "compctl -x ... -l ..." is the real meat And the one I really didn't understand. I mean, the -x args (specially p, P and r comes to mind) delimit a portion of the command line that must be completed specially (well, more or less), and the -l says if it must be completed as a command itself or as an specified command. No problem with it. What confused me is the documentation about -l: -l CMD This option restricts the range of command line words that are considered to be arguments. [...] . Completion is then performed as if these had been given as arguments to the CMD supplied with the option. IMHO, this option doesn't really restricts what in the command line is an argument :??? It is more like an alias. The only way of really restricting ranges is using -x. And the second paragraph... Well, I must admit that my completion knowledge is worse than my english, but I don't get the meaning of that... The completion is performed in two ways: command-like or using 'CMD' completion :?? > Note that order is important with "-x" Yes, I've read that in the manual. > Of course this stuff about -x generalizes to other options besides -l, > but -l is what you were asking about ... I've used it with -u, for example, for completing user names, just like the example in the manual. Well, thanks a lot for your explanation. The fact is that I got more or less well how -l works, but the documentation is bizarre... Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.pleyades.net & http://raul.pleyades.net/