Ville Skyttä 86ca9ee598 Replace $UNAME with $OSTYPE in trivial cases.
$OSTYPE is automatically available at runtime (for dynamic loading).
2011-10-12 23:07:21 +03:00

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