zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _modutils update for kernel 2.6
@ 2004-12-10 11:10 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2004-12-10 11:10 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Mandrake ships compressed modules for 2.6, currently they are completed to 
module.ko that modprobe does not like. Patch simply strips off everything 
after first dot (I do not think any module is using dot in names or vene if 
this is allowed).

Also it adds trivial insmod support for module-init-tools enough for 2.6 (I am 
testing kernel module and being lazy ... :) I set styles as

if [[ "$(modprobe -V 2> /dev/null)" == module-init-tools* ]]; then
        zstyle ':completion:*:*:insmod:*' file-patterns '*.ko:modules 
*(-/):directories' '*:all-files'
else
        zstyle ':completion:*:*:insmod:*' file-patterns '*.o:modules 
*(-/):directories' '*:all-files'
fi

may be it makes sense to put in _modutils as default.

regards

-andrey

[-- Attachment #2: _modutils.diff --]
[-- Type: text/x-diff, Size: 1171 bytes --]

Index: Completion/Linux/Command/_modutils
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Linux/Command/_modutils,v
retrieving revision 1.4
diff -u -p -r1.4 _modutils
--- Completion/Linux/Command/_modutils	13 Feb 2004 18:42:25 -0000	1.4
+++ Completion/Linux/Command/_modutils	10 Dec 2004 10:52:38 -0000
@@ -1,4 +1,4 @@
-#compdef lsmod modinfo modprobe rmmod
+#compdef lsmod modinfo modprobe rmmod insmod
 
 local curcontext="$curcontext" expl state line modules ign args ret=1
 
@@ -51,6 +51,12 @@ case "$service" in
       '(-v --verbose)'{-v,--verbose}'[be verbose]' \
       '*:loaded module:->loaded_modules' && ret=0
   ;;
+
+  insmod)
+    _arguments \
+      '1:module file:_files' \
+      '*:module parameters:' && ret=0
+  ;;
 esac 
 
 case "$state" in
@@ -67,7 +73,7 @@ case "$state" in
   ;;
 
   all_modules)
-    modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%.*} )
+    modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%%.*} )
     _wanted modules expl module compadd -a modules && return
   ;;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-10 11:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-10 11:10 [PATCH] _modutils update for kernel 2.6 Andrey Borzenkov

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).