PageRenderTime 71ms CodeModel.GetById 66ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/pkg_install

http://github.com/brinkman83/bashrc
#! | 31 lines | 23 code | 8 blank | 0 comment | 0 complexity | af0fbd399bd5eaaf5a727c5041dfcaaf MD5 | raw file
 1# bash completion for FreeBSD base package management tools
 2
 3[ $UNAME = FreeBSD ] &&
 4{
 5
 6_pkg_delete()
 7{
 8    local cur pkgdir prev
 9
10    pkgdir=${PKG_DBDIR:-/var/db/pkg}/
11    cur=`_get_cword`
12    prev=${COMP_WORDS[COMP_CWORD-1]}
13
14    [ "$prev" = "-o" -o "$prev" = "-p" -o "$prev" = "-W" ] && return 0
15
16    COMPREPLY=( $( compgen -d "$pkgdir$cur" ) )
17    COMPREPLY=( ${COMPREPLY[@]#$pkgdir} )
18
19    return 0
20}
21complete -F _pkg_delete $dirnames pkg_delete pkg_info
22
23}
24
25# Local variables:
26# mode: shell-script
27# sh-basic-offset: 4
28# sh-indent-comment: t
29# indent-tabs-mode: nil
30# End:
31# ex: ts=4 sw=4 et filetype=sh