From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5314 invoked from network); 16 May 2001 12:33:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 May 2001 12:33:21 -0000 Received: (qmail 935 invoked by alias); 16 May 2001 12:33:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14362 Received: (qmail 902 invoked from network); 16 May 2001 12:33:09 -0000 Date: Wed, 16 May 2001 08:32:55 -0400 From: Clint Adams To: Oliver Kiddle Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: rmmod/modprobe -r completion Message-ID: <20010516083255.A11718@dman.com> References: <20010514222601.A18298@dman.com> <3B014622.7EE4888@u.genie.co.uk> <20010516080047.A11461@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010516080047.A11461@dman.com>; from clint@zsh.org on Wed, May 16, 2001 at 08:00:47AM -0400 > Well, modprobe could benefit from the use of states, so here's > modprobe supporting a few more options: And here's some more. Index: Completion/Unix/Command/_modutils =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_modutils,v retrieving revision 1.3 diff -u -r1.3 _modutils --- Completion/Unix/Command/_modutils 2001/05/16 12:02:17 1.3 +++ Completion/Unix/Command/_modutils 2001/05/16 12:30:41 @@ -47,11 +47,25 @@ '(--autoclean)-k[set autoclean]' \ '(-k)--autoclean' \ '(--show)-n[do not act]' \ - '(-n)--show' + '(-n)--show' \ + '(--quiet)-q[do not complain about insmod failures]' \ + '(-q)--quiet' \ + '(--syslog)-s[report via syslog instead of stderr]' \ + '(-s)--syslog' \ + '(--type)-t[module type]:moduletype:' \ + '(-t)--type:moduletype:' \ + '(--verbose)-v[print all commands as executed]' \ + '(-v)--verbose' \ + '(--version)-V[show release version]' \ + '(-V)--version' \ + '(--config)-C[config file]:config file:_files' \ + '(-C)--config:config file:_files' ) _arguments '(--remove)-r[remove]:*:loaded module:->modprobe_remove' \ '(-r)--remove:*:loaded module:->modprobe_remove' \ + '(--list)-l[list matching modules]:*:module file:->modprobe_list' \ + '(-l)--list:*:module file:->modprobe_list' \ "$_modprobe_arguments[@]" && return 0 ;; @@ -64,5 +78,10 @@ _arguments "$_modprobe_arguments[@]" \ '*:loaded module:_modutils_loaded_modules' ;; + + modprobe_list) + _call_function ret _modutils_$state && return ret + _arguments "$_modprobe_arguments[@]" \ + '*:module file:compadd ${^${(M)${(f)"$(modprobe -c)"}:#path*}#*[=]}/**/*.o(:t)' esac