From 9599d45c3c8ae5bc6b2780cd2013db4daed3c242 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 22 Jun 2010 16:31:42 +0200 Subject: Prepare _modprobe for proper -r support --- etc/completions/_modprobe | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/completions/_modprobe b/etc/completions/_modprobe index cc6bdfe..d55d739 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_module' + '*:module:_modprobe_all_modules' ) for arg in ${(k)argument_pairs}; { @@ -61,10 +61,16 @@ for arg in ${(k)argument_pairs}; { arguments+='(-'${argument_pairs[$arg]}[1]')--'${arg}${argument_postfix[$arg]} } -function _modprobe_module { +function _modprobe_all_modules { typeset expl _wanted module expl module \ compadd ${$(echo /lib/modules/$(uname -r)/**/*.ko):t:r} } +function _modprobe_loaded_modules { + typeset expl + _wanted module expl module \ + compadd $(cut -d\ -f1 < /proc/modules) +} + _arguments -s ${arguments} -- cgit v1.2.3