summaryrefslogtreecommitdiffstats
path: root/completions/portupgrade
blob: 1dc93c2710f609d6adc1283ac8d5cf390c62e9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# bash completion for FreeBSD portupgrade                  -*- shell-script -*-

_comp_cmd_portupgrade()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    [[ $prev == -l || $prev == -L || $prev == -o ]] && return

    local pkgdir=${PKG_DBDIR:-/var/db/pkg}/

    _comp_compgen -c "$pkgdir$cur" -- -d
    COMPREPLY=("${COMPREPLY[@]#"$pkgdir"}")
    COMPREPLY=("${COMPREPLY[@]%-*}")

} &&
    complete -F _comp_cmd_portupgrade -o dirnames portupgrade

# ex: filetype=sh