summaryrefslogtreecommitdiff
path: root/etc/completions/_modprobe
diff options
context:
space:
mode:
Diffstat (limited to 'etc/completions/_modprobe')
-rw-r--r--etc/completions/_modprobe17
1 files changed, 15 insertions, 2 deletions
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}