zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: zsh-workers@sunsite.dk
Subject: [PATCH] _modutils update for kernel 2.6
Date: Fri, 10 Dec 2004 14:10:58 +0300	[thread overview]
Message-ID: <200412101410.58449.arvidjaar@mail.ru> (raw)

[-- 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
   ;;
 

                 reply	other threads:[~2004-12-10 11:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200412101410.58449.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).