From a3dd790b9ea2ab530a02a582d446ac376541f57a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 22 Jun 2010 16:36:31 +0200 Subject: _modprobe: Complete only loaded modules for -r --- etc/completions/_modprobe | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'etc/completions') diff --git a/etc/completions/_modprobe b/etc/completions/_modprobe index d55d739..629d1dd 100644 --- a/etc/completions/_modprobe +++ b/etc/completions/_modprobe @@ -53,7 +53,7 @@ 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_all_modules' + '*:module:_modprobe_module' ) for arg in ${(k)argument_pairs}; { @@ -73,4 +73,12 @@ function _modprobe_loaded_modules { compadd $(cut -d\ -f1 < /proc/modules) } +function _modprobe_module { + if [[ ${words[(I)-r]} == 0 ]] { + _modprobe_all_modules + } else { + _modprobe_loaded_modules + } +} + _arguments -s ${arguments} -- cgit v1.2.3