1
# Linux modprobe(8) completion -*- shell-script -*-
5
local cur prev words cword
6
_init_completion || return
13
-d|--dirname|-t|--type)
23
if [[ "$cur" == -* ]]; then
24
COMPREPLY=( $( compgen -W '-a --all -b --use-blacklist -C --config -c
25
--showconfig --dump-modversions -d --dirname --first-time
26
--force-vermagic --force-modversion -f --force -i --ignore-install
27
--ignore-remove -l --list -n --dry-run -q --quiet -R
28
--resolve-alias -r --remove -S --set-version --show-depends -s
29
--syslog -t --type -V --version -v --verbose' -- "$cur" ) )
33
local i mode=insert module= version=$(uname -r)
34
for (( i=1; i < $cword; i++ )); do
46
version=${words[i+1]} # -S is not $prev and not $cur
48
-C|--config|-d|--dirname|-t|--type)
49
((i++)) # skip option and its argument
52
# skip all other options
55
[ -z "$module" ] && module=${words[i]}
62
_installed_modules "$cur"
65
# no completion available
71
# do filename completion if we're giving a path to a module
72
if [[ "$cur" == @(*/|[.~])* ]]; then
73
_filedir '@(?(k)o?(.gz))'
74
elif [[ -n "$module" ]]; then
75
# do module parameter completion
76
COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \
77
-p "$module" 2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
84
complete -F _modprobe modprobe
86
# ex: ts=4 sw=4 et filetype=sh