about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Linux/Command/_modutils13
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f278e912..74659f563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-10-07  Clint Adams  <clint@zsh.org>
 
+	* Jörg Sommer: 25819: Completion/Linux/Command/_modutils: improve
+	module parameter completion.
+
 	* Jörg Sommer: 25822: Completion/Linux/Command/_modutils: declare
 	val_args as local array.
 
diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils
index faab85275..eefb11f2a 100644
--- a/Completion/Linux/Command/_modutils
+++ b/Completion/Linux/Command/_modutils
@@ -95,10 +95,17 @@ case "$state" in
     if compset -P '*='; then
       _message -e value 'parameter value'
     else
-      typeset -A val_args
+      local params
+      params=( ${${(M)${(f)"$(_call_program module_parameter modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} )
+      if [[ $#params -eq 0 ]]; then
+        _message -e parameter "This modules doesn't have parameters"
+      else
+        typeset -A val_args
 
-      _values 'module parameter' \
-        ${(f)^"$(_call_program module_parameter modinfo -F parm "$words[2]" 2>/dev/null)"//:/\=[}\] && ret=0
+        _values -S = -C -w 'module parameter' \
+          ${${${(M)params:#*(:bool|\(bool\))}/:/[}/(bool| \(bool\))/]} \
+          ${^${params:#*(:bool|\(bool\))}/:/[}"]:auto added argument: " && ret=0
+      fi
     fi
   ;;
 esac