summaryrefslogtreecommitdiff
path: root/completions/kldload
blob: 4817679e1e81836e4d343625ace13d221562a1c7 (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