2011-11-01 22:14:45 +02:00
|
|
|
# FreeBSD kldload completion -*- shell-script -*-
|
2009-06-08 20:41:52 +03:00
|
|
|
|
2011-10-12 23:07:21 +03:00
|
|
|
[[ $OSTYPE == *freebsd* ]] || return 1
|
2009-06-08 20:41:52 +03:00
|
|
|
|
|
|
|
_kldload()
|
|
|
|
{
|
2011-04-20 22:12:53 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2009-06-08 20:41:52 +03:00
|
|
|
|
2011-04-20 22:12:53 +03:00
|
|
|
local moddir=/modules/
|
2011-11-09 23:28:11 +02:00
|
|
|
[[ -d $moddir ]] || moddir=/boot/kernel/
|
2009-06-08 20:41:52 +03:00
|
|
|
|
2011-04-21 12:33:05 +03:00
|
|
|
compopt -o filenames
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -f "$moddir$cur" ) )
|
|
|
|
COMPREPLY=( ${COMPREPLY[@]#$moddir} )
|
|
|
|
COMPREPLY=( ${COMPREPLY[@]%.ko} )
|
2009-06-08 20:41:52 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
return 0
|
2011-04-04 22:14:39 +03:00
|
|
|
} &&
|
2010-11-01 19:26:53 +02:00
|
|
|
complete -F _kldload kldload
|
2009-06-08 20:41:52 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|