From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 422 invoked from network); 14 May 2008 16:41:03 -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.6 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 16:41:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 13028 invoked from network); 14 May 2008 16:40:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 May 2008 16:40:58 -0000 Received: (qmail 13665 invoked by alias); 14 May 2008 16:40:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25032 Received: (qmail 13648 invoked from network); 14 May 2008 16:40:54 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 May 2008 16:40:54 -0000 Received: from vms173005pub.verizon.net (vms173005pub.verizon.net [206.46.173.5]) by bifrost.dotsrc.org (Postfix) with ESMTP id 634F980ED172 for ; Wed, 14 May 2008 18:40:50 +0200 (CEST) Received: from torch.brasslantern.com ([71.116.113.54]) by vms173005.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K0V00BKMA1YVLA0@vms173005.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 14 May 2008 11:34:47 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m4EGekXg011977 for ; Wed, 14 May 2008 09:40:47 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m4EGekLt011976 for zsh-workers@sunsite.dk; Wed, 14 May 2008 09:40:46 -0700 Date: Wed, 14 May 2008 09:40:46 -0700 From: Bart Schaefer Subject: Re: functions/Completion/Linux/_modutils In-reply-to: <482B1123.5050206@sergio.spb.ru> To: zsh-workers@sunsite.dk Message-id: <080514094046.ZM11975@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <4829BF7A.20203@sergio.spb.ru> <080513201714.ZM10079@torch.brasslantern.com> <482AF445.3080909@sergio.spb.ru> <080514085511.ZM11897@torch.brasslantern.com> <482B1123.5050206@sergio.spb.ru> Comments: In reply to sergio "Re: functions/Completion/Linux/_modutils" (May 14, 8:19pm) X-Virus-Scanned: ClamAV 0.91.2/7122/Wed May 14 18:09:29 2008 on bifrost X-Virus-Status: Clean On May 14, 8:19pm, sergio wrote: } } > % zstyle :complete:sudo: environ \ } > PATH="/sbin:/usr/sbin:$PATH" HOME="/root" } > % sudo modprobe } Hmm.. How zsh searches command when I type 'sudo ' } It will be better to get $path from that logic. That just calls _command_names, which doesn't do anything magical at all; in fact I'd expect it not to find modprobe if calling modprobe later will fail for path reasons. The path needs to be set where I set it in that patch, before any completers are invoked. } > Of course it would be preferable if "sudo -H /tmp/foo" would export } > HOME=/tmp/foo, and if the style could be specialized to the target } > user for "sudo -u" and so on, but I'm not prepared to go that far } > overboard just now. } But it's not very difficult.. ? (: It means dismantling the simple _arguments call into something that uses state transitions to capture values as each argument is examined. I don't believe that's worth the effort (it's certainly not worth *my* effort, as I'm perfectly happy with the way it's been working for the last seven years).