Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: rmmod/modprobe -r completion



> 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



Messages sorted by: Reverse Date, Date, Thread, Author