2000-04-20 11:45:04 +02:00
|
|
|
#compdef kldload kldunload
|
|
|
|
|
|
|
|
(( $+functions[_kld_module] )) ||
|
|
|
|
_kld_module() {
|
|
|
|
local ret=1
|
|
|
|
|
2000-10-06 15:01:51 +02:00
|
|
|
compadd "$@" - /boot/kernel/*.ko(:t) /modules/*.ko(:t) && ret=0
|
2000-04-20 11:45:04 +02:00
|
|
|
_files "$@" -g \*.ko && ret=0
|
|
|
|
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
(( $+functions[_kld_unload] )) ||
|
|
|
|
_kld_unload() {
|
|
|
|
compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $5 }' )
|
|
|
|
}
|
|
|
|
|
|
|
|
(( $+functions[_kld_unload_id] )) ||
|
|
|
|
_kld_unload_id() {
|
|
|
|
compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $1 }' )
|
|
|
|
}
|
|
|
|
|
|
|
|
_kld() {
|
2001-01-15 10:11:31 +01:00
|
|
|
case "$service" in
|
2000-04-20 11:45:04 +02:00
|
|
|
kldload)
|
|
|
|
_arguments -s \
|
|
|
|
'-v[be verbose]' \
|
|
|
|
'*:module to load:_kld_module'
|
|
|
|
;;
|
|
|
|
|
|
|
|
kldunload)
|
|
|
|
_arguments -s \
|
|
|
|
'-v[be verbose]' \
|
|
|
|
'(-n)-i:module id to unload:_kld_unload_id' \
|
|
|
|
'(-i)-n:module to unload:_kld_unload' \
|
|
|
|
'*:module to unload:_kld_unload'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2000-08-01 10:26:39 +02:00
|
|
|
_kld "$@"
|