summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/completions/_modprobe10
1 files 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}