summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-05-16 12:02:17 +0000
committerClint Adams <clint@users.sourceforge.net>2001-05-16 12:02:17 +0000
commit96ca999e739ad8aeb2581e8b82a9e4a54a766daa (patch)
treed9d165bc8873ea7dac3472166023b5e59196da34
parent8e20d1da63d320c599490a222c33543201893b5e (diff)
downloadzsh-96ca999e739ad8aeb2581e8b82a9e4a54a766daa.tar.gz
zsh-96ca999e739ad8aeb2581e8b82a9e4a54a766daa.tar.xz
zsh-96ca999e739ad8aeb2581e8b82a9e4a54a766daa.zip
14361: better modprobe completion
-rw-r--r--ChangeLog7
-rwxr-xr-xCompletion/Unix/Command/_modutils31
2 files changed, 35 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6cf32b473..602b272b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-16  Clint Adams  <clint@zsh.org>
+
+	* 14361: Completion/Unix/Command/_modutils: use
+	state for modprobe so that modprobe -r will
+	complete multiple loaded modules.  Also
+	handle more of modprobe's options.
+
 2001-05-16  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 14359: Src/Zle/zle_tricky.c: more fixage for expansion: just
diff --git a/Completion/Unix/Command/_modutils b/Completion/Unix/Command/_modutils
index 1a725e511..6021f0aec 100755
--- a/Completion/Unix/Command/_modutils
+++ b/Completion/Unix/Command/_modutils
@@ -32,12 +32,37 @@ case "$service" in
              '(-v)--verbose' \
              '(--version)-V[print version]' \
              '(-V)--version' \
-             '*:loaded module:_modutils_loaded_modules'
+             '*:loaded module:_modutils_loaded_modules' && return 0
   ;;
 
   modprobe)
-  _arguments '(--remove)-r[remove]:loaded module:_modutils_loaded_modules' \
-             '(-r)--remove:loaded module:_modutils_loaded_modules'
+
+  _modprobe_arguments=(
+             '(--all)-a[all]' \
+             '(-a)--all' \
+             '(--showconfig)-c[showconfig]' \
+             '(-c)--showconfig' \
+             '(--debug)-d[debug]' \
+             '(-d)--debug' \
+             '(--autoclean)-k[set autoclean]' \
+             '(-k)--autoclean' \
+             '(--show)-n[do not act]' \
+             '(-n)--show'
+  )
+
+  _arguments '(--remove)-r[remove]:*:loaded module:->modprobe_remove' \
+             '(-r)--remove:*:loaded module:->modprobe_remove' \
+	     "$_modprobe_arguments[@]" && return 0
+
+  ;;
+
+esac 
+
+case "$state" in
+  modprobe_remove)
+        _call_function ret _modutils_$state && return ret
+        _arguments "$_modprobe_arguments[@]" \
+                   '*:loaded module:_modutils_loaded_modules'
   ;;
 
 esac