From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28927 invoked from network); 14 May 2008 15:18:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 May 2008 15:18:59 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 86487 invoked from network); 14 May 2008 15:18:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 May 2008 15:18:53 -0000 Received: (qmail 22955 invoked by alias); 14 May 2008 15:18:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25028 Received: (qmail 22938 invoked from network); 14 May 2008 15:18:49 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 May 2008 15:18:49 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id 084D580ED173 for ; Wed, 14 May 2008 17:18:42 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly10d.srv.mailcontrol.com (MailControl) with ESMTP id m4EFIJ5J007031 for ; Wed, 14 May 2008 16:18:41 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 May 2008 16:18:34 +0100 Date: Wed, 14 May 2008 16:18:34 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: functions/Completion/Linux/_modutils Message-ID: <20080514161834.0b96c7ac@news01> In-Reply-To: <482AF445.3080909@sergio.spb.ru> References: <4829BF7A.20203@sergio.spb.ru> <080513201714.ZM10079@torch.brasslantern.com> <482AF445.3080909@sergio.spb.ru> Organization: CSR X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 May 2008 15:18:34.0245 (UTC) FILETIME=[C677A350:01C8B5D5] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.120 X-Virus-Scanned: ClamAV 0.91.2/7121/Wed May 14 16:17:09 2008 on bifrost X-Virus-Status: Clean On Wed, 14 May 2008 18:16:37 +0400 sergio wrote: > Bart Schaefer wrote: > > On May 13, 8:19pm, sergio wrote: > > } > > } When i'm not root modprobe is not in my path, so > > } in case "all_modules)" "modules" will be empty: > > > > When completing for what? An example command line would be helpful. > > sudo modprobe should list all available modules (may be all not > loaded modules) but it doesn't. Shouldn't the fix be something like this? By the way, isn't that "_files" completion three lines below screwy? Shouldn't it be looking for .ko files (or possibly .o files depending on the version)? Index: Completion/Linux/Command/_modutils =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Linux/Command/_modutils,v retrieving revision 1.6 diff -u -r1.6 _modutils --- Completion/Linux/Command/_modutils 12 Aug 2007 09:04:52 -0000 1.6 +++ Completion/Linux/Command/_modutils 14 May 2008 15:11:48 -0000 @@ -73,7 +73,7 @@ ;; all_modules) - modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%%.*} ) + modules=( ${${${${(f)"$(path=($path /sbin); _call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%%.*} ) _tags files modules while _tags; do _requested files expl "module file" _files && ret=0 -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070