# FreeBSD kldunload completion                             -*- shell-script -*-

[[ $OSTYPE == *freebsd* ]] || return 1

_kldunload()
{
    local cur prev words cword
    _init_completion || return

    COMPREPLY=($(compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur"))
    COMPREPLY=(${COMPREPLY[@]%.ko})
} &&
    complete -F _kldunload kldunload

# ex: filetype=sh
