#compdef pkg_fetch

(( $+functions[_pkg_basename] )) ||
_pkg_basename() {
    local ret=1 l

    l=( ${PKGDBDIR:-/var/db/pkg}/*(/:t) )

    compadd "$@" - ${l[@]%-*} && ret=0

    return ret
}

_arguments -s \
 '-f[force to download a pacakge even if it is already installed]' \
 '-r[download recursively]' \
 '-v[be verbose]' \
 '*:package to download:_pkg_basename'
