# FreeBSD kldload completion -*- shell-script -*- [[ $OSTYPE == *freebsd* ]] || return 1 proc _kldload { var cur = '', prev = '', words = '', cword = '' _init_completion || return var moddir = '/modules/' [[ -d $moddir ]] || set moddir = '/boot/kernel/' compopt -o filenames setglobal COMPREPLY = '( '$( compgen -f "$moddir$cur" ) ) setglobal COMPREPLY = '( '${COMPREPLY[@]#$moddir} ) setglobal COMPREPLY = '( '${COMPREPLY[@]%.ko} ) return 0 } && complete -F _kldload kldload # ex: ts=4 sw=4 et filetype=sh