Ville Skyttä 86ca9ee598 Replace $UNAME with $OSTYPE in trivial cases.
$OSTYPE is automatically available at runtime (for dynamic loading).
2011-10-12 23:07:21 +03:00

28 lines
622 B
Bash

# bash completion for FreeBSD base package management tools
[[ $OSTYPE == *freebsd* ]] || return 1
_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 pkg_deinstall
# 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