From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16646 invoked from network); 27 Sep 2008 22:08:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Sep 2008 22:08:17 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 93111 invoked from network); 27 Sep 2008 22:08:02 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Sep 2008 22:08:02 -0000 Received: (qmail 9805 invoked by alias); 27 Sep 2008 22:07:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25762 Received: (qmail 9788 invoked from network); 27 Sep 2008 22:07:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Sep 2008 22:07:53 -0000 Received: from uucp.gnuu.de (banki.eumelnet.de [83.246.114.63]) by bifrost.dotsrc.org (Postfix) with ESMTP id 004A480308B9 for ; Sun, 28 Sep 2008 00:07:49 +0200 (CEST) Received: by uucp.gnuu.de (Postfix, from userid 10) id 4898A488009; Sun, 28 Sep 2008 00:07:49 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.5.2 uucp.gnuu.de 4898A488009 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuu.de; s=banki; t=1222553269; i=@alea.gnuu.de; bh=BSaZRza6TRqPQkATAzq7yW+leDYQdUTdI ak16JAUF1Q=; h=To:From:Subject:Date:Message-ID:References: Mime-Version:Content-Type:Content-Transfer-Encoding:Sender; b=kv8q egvl1sL7wxElDi/VHDyUB3PeNLDCVu14F126lOmjVX6moYHTdvr2eMAkO+PAXCiSXBD 9sC9VGJNyqrL9IWokae3wrXazSLNG3EX2Q8Ixp8krs23vi8F/7BEyt3uUuzON+xgIjI Mxfpbj/JS5tOAnMWFUVRU76F0gaDJGg8A= Received: from news by alea.gnuu.de with local (Exim 4.63) (envelope-from ) id 1Kjgpt-0007Mq-SW for zsh-workers@sunsite.dk; Sat, 27 Sep 2008 22:56:18 +0200 To: zsh-workers@sunsite.dk Path: not-for-mail From: =?UTF-8?Q?J=C3=B6rg?= Sommer Newsgroups: local.mailinglist.zsh Subject: Re: Next improve of completion of modprobe module parameters Date: Sat, 27 Sep 2008 20:56:17 +0000 (UTC) Message-ID: References: <080926190649.ZM3653@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: alea.gnuu.de 1222548977 28285 192.168.0.5 (27 Sep 2008 20:56:17 GMT) X-Complaints-To: usenet@alea.gnuu.de User-Agent: slrn/0.9.9 (Linux) Sender: news X-Virus-Scanned: ClamAV 0.92.1/8346/Sat Sep 27 09:08:52 2008 on bifrost X-Virus-Status: Clean Hello Bart, Bart Schaefer wrote: > On Sep 26, 10:35pm, joerg@alea.gnuu.de wrote: >} >} % a=12\|4 >} % b=( {10..15} ) >} % echo ${b:#($a)} >} 10 11 12 13 14 15 >} % eval "echo \${b:#($a)}" >} 10 11 13 14 15 >} >} Why doesn't the non-eval version work? > > echo ${b:#($~a)} > > The "|" in $a is implicitly quoted unless you use $~a. Thanks for the enlightenment. This is a better version of the patch: commit b715bc93beb7c39297435926c17a18178e6e50aa Author: Jörg Sommer Date: Fri Sep 26 20:56:43 2008 +0200 Print only non‐loaded modules as modprobe completion diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index 378c2d5..06e9b14 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -38,7 +38,7 @@ case "$service" in '(-C --config)'{-C,--config}'[specify config file]:config file:_files' \ "(-r --remove -l --list -t --type -a --all $ign)"{-r,--remove}'[remove module (stacks)]' \ "(* -l --list -r --remove $ign)"{-l,--list}'[list matching modules]' \ - "(-c $ign)1:modules:->all_modules" \ + "(-c $ign)1:modules:->loadable_modules" \ "(-c -l --list -t --type $ign)*:params:->params" && ret=0 [[ -n $state ]] && (( $+opt_args[-r] )) && state=loaded_modules @@ -62,20 +62,28 @@ case "$service" in esac case "$state" in - loaded_modules) + loaded_modules|loadable_modules) if [[ -r /proc/modules ]]; then - modules=(${${(f)"$(/dev/null)"}:#}##*/}%%.*} ) + + if [[ $state = loadable_modules ]]; then + modules=( ${modules:#(${(j:|:)~${loaded_modules//_/-}})} ) + fi + _tags files modules while _tags; do _requested files expl "module file" _files -g '*.ko' && ret=0 Bye, Jörg. -- Objektivität ist die Wahnvorstellung, Beobachtungen könnten ohne Beobachter gemacht werden – Heinz v. Foerster