From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8386 invoked from network); 2 Mar 2006 12:37:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Mar 2006 12:37:52 -0000 Received: (qmail 36121 invoked from network); 2 Mar 2006 12:37:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Mar 2006 12:37:44 -0000 Received: (qmail 9502 invoked by alias); 2 Mar 2006 12:37:37 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9976 Received: (qmail 9493 invoked from network); 2 Mar 2006 12:37:37 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Mar 2006 12:37:37 -0000 Received: (qmail 35045 invoked from network); 2 Mar 2006 12:37:37 -0000 Received: from parhelion.firedrake.org (193.201.200.77) by a.mx.sunsite.dk with SMTP; 2 Mar 2006 12:37:36 -0000 Received: from phil by parhelion.firedrake.org with local (Exim 4.50 #1 (Debian)) id 1FEn3n-0004kc-8u for ; Thu, 02 Mar 2006 12:37:35 +0000 Date: Thu, 2 Mar 2006 13:37:35 +0100 From: Phil Pennock To: zsh-users@sunsite.dk Subject: completion argument-n enabling Message-ID: <20060302123735.GA16201@parhelion.globnix.org> Mail-Followup-To: zsh-users@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Phil Pennock Continuing my education in my own stupidity, I continue to have problems trying to migrate to the zshcompsys completion. I write small shell convenience functions and used to write compctl settings for them. In this instance, I've gotten most of the way there. I'm sure that the answers are really simple and education is appreciated. Thanks. Given: function cyrus { sudo -H -u cyrus "/usr/lib/cyrus/$1" "${argv[2,-1]}" } I've managed to produce a mostly-working set-up: zstyle ':completion:*:*:cyrus:*' file-patterns '/usr/lib/cyrus/*(*\:t)' However, I only want that completion to occur for the first parameter; but argument-n context needs to be enabled and I can't figure out how to do that. To make: zstyle ':completion:*:*:cyrus:argument-1:*' file-patterns \ '/usr/lib/cyrus/*(*\:t)' work, what do I actually need to do please? The nearest that I could figure out was: zstyle ':completion:*:*:cyrus:*:arguments' _normal but that doesn't work. Also, if I instead use: compdef '_files -g "/usr/lib/cyrus/*(*:t)"' -P '' cyrus (I know, it deals with all parameters, not just the first) why am I prompted with two sets of results, the correct filenames and then the sub-directories of the cwd? Are there any simple examples which I should be looking for, covering this sort of thing? The stuff I can find all uses custom _cmdname widgets and I couldn't find anything just offering plain "how to do X" for the sort of thing I'm attempting. The nearest seems to be StartupFiles/zshrc which falls just shy of providing an example of per-command completion. Thanks, -- I am keeping international relations on a peaceable footing. You are biding your time before acting. He is coddling tyrants. -- Roger BW on topic of verb conjugation