summaryrefslogtreecommitdiffstats
path: root/completions/kldload
blob: f5111584c0b3c2a55a8e526d703399044899dc07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# FreeBSD kldload completion                               -*- shell-script -*-

[[ $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})

} &&
    complete -F _kldload kldload

# ex: filetype=sh