86ca9ee598
$OSTYPE is automatically available at runtime (for dynamic loading).
29 lines
565 B
Bash
29 lines
565 B
Bash
# FreeBSD kldload completion
|
|
|
|
[[ $OSTYPE == *freebsd* ]] || return 1
|
|
|
|
_kldload()
|
|
{
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
local moddir=/modules/
|
|
[ -d $moddir ] || moddir=/boot/kernel/
|
|
|
|
compopt -o filenames
|
|
COMPREPLY=( $( compgen -f "$moddir$cur" ) )
|
|
COMPREPLY=( ${COMPREPLY[@]#$moddir} )
|
|
COMPREPLY=( ${COMPREPLY[@]%.ko} )
|
|
|
|
return 0
|
|
} &&
|
|
complete -F _kldload kldload
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 4
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: nil
|
|
# End:
|
|
# ex: ts=4 sw=4 et filetype=sh
|