From 3ae614b7c3f446179c486a4874c02574148bbe43 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 23 Jun 2010 11:53:13 +0200 Subject: _modprobe: (sort of) fix -a handling --- etc/completions/_modprobe | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'etc/completions/_modprobe') diff --git a/etc/completions/_modprobe b/etc/completions/_modprobe index 629d1dd..4e9e6ed 100644 --- a/etc/completions/_modprobe +++ b/etc/completions/_modprobe @@ -53,7 +53,8 @@ arguments=( '--force-vermagic[Ignore version magic when loading modules]' '--force-modversion[Ignore CONFIG_MODVERSION when loading modules]' '--show-depends[List dependencies of a module]' - '*:module:_modprobe_module' + ':module:_modprobe_module' + '*:module name or argument:_modprobe_module_or_arg' ) for arg in ${(k)argument_pairs}; { @@ -73,12 +74,24 @@ function _modprobe_loaded_modules { compadd $(cut -d\ -f1 < /proc/modules) } +function _modprobe_module_args { + _message 'module arguments' +} + function _modprobe_module { - if [[ ${words[(I)-r]} == 0 ]] { + if [[ ${words[(I)(-r|--remove)]} == 0 ]] { _modprobe_all_modules } else { _modprobe_loaded_modules } } +function _modprobe_module_or_arg { + if [[ ${words[(I)(-a|--all)]} == 0 ]] { + _modprobe_module_args + } else { + _modprobe_module + } +} + _arguments -s ${arguments} -- cgit v1.2.3