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

[PATCH] Use modinfo to complete module parameter



Hi,

I would like to have zsh completes the parameter of a kernel module at
modprobe. I'm not very familiar with zsh completion, but maybe someone
can beautify it:

diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils
index cc7034f..7322903 100644
--- a/Completion/Linux/Command/_modutils
+++ b/Completion/Linux/Command/_modutils
@@ -85,7 +85,8 @@ case "$state" in
     if compset -P '*='; then
       _message -e value 'parameter value'
     else
-      _message -e parameter 'module parameter'
+      _values 'module parameter' \
+        ${(f)^"$(_call_program module_parameter modinfo -F parm "$words[2]" 2>/dev/null)"//:/\=[}\]
     fi
   ;;
 esac

Bye, Jörg.
-- 
Wer einen Traum verwirklichen will, muss erst aufwachen.



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