2011-04-20 23:13:29 +03:00

28 lines
600 B
Bash

# bash completion for FreeBSD base package management tools
[ $UNAME = FreeBSD ] || return
_pkg_delete()
{
local cur prev words cword
_init_completion || return
local pkgdir=${PKG_DBDIR:-/var/db/pkg}/
[[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return 0
COMPREPLY=( $( compgen -d "$pkgdir$cur" ) )
COMPREPLY=( ${COMPREPLY[@]#$pkgdir} )
return 0
} &&
complete -F _pkg_delete -o dirnames pkg_delete pkg_info
# 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