$NetBSD: patch-bash__completion,v 1.1 2013/05/10 12:01:51 imil Exp $ Added pkgsrc and pkg_install completions --- bash_completion.orig 2013-04-05 10:55:51.000000000 +0000 +++ bash_completion @@ -1365,6 +1365,34 @@ _terms() extract patch configure build install reinstall deinstall clean clean-depends kernel buildworld' make +# a little help for NetBSD pkgsrc users +[[ $OSTYPE = *netbsd* ]] && complete -W 'index search fetch fetch-list \ + extract patch configure build install reinstall \ + deinstall package clean clean-depends' make + + +[[ $OSTYPE = *netbsd* ]] && { +# NetBSD package management tool completion +# +_pkg_delete() +{ + local cur pkgdir prev + + pkgdir=${PKG_DBDIR:-/var/db/pkg}/ + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + [ "$prev" = "-o" -o "$prev" = "-p" -o "$prev" = "-W" ] && return 0 + + COMPREPLY=( $( compgen -d $pkgdir$cur ) ) + COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) + + return 0 +} +complete -F _pkg_delete $dirnames pkg_delete pkg_info +have pkg_deinstall && complete -F _pkg_delete $dirnames pkg_deinstall +} + # This function provides simple user@host completion # _user_at_host()