#compdef _pactree pactree

function _pactree() {
	_arguments \
		{-a,--ascii}"[use ASCII characters for tree formatting]" \
		{-b,--dbpath}"[set an alternate database location]:location:_files" \
		{-c,--color}"[colorize output]" \
		{-d,--depth}"[limit the depth of recursion]:depth:" \
		{-g,--graph}"[generate output for graphviz's dot]" \
		{-h,--help}"[display this help message]" \
		{-l,--linear}"[enable linear output]" \
		{-r,--reverse}"[list packages that depend on the named package]" \
		{-s,--sync}"[search sync databases instead of local]" \
		{-u,--unique}"[show dependencies with no duplicates (implies -l)]" \
		{-v,--version}"[display the version]" \
		":PACKAGE:_pactree_installed_packages"
	}

function _pactree_installed_packages() {
	local packages=($(pacman -Qq))
	_describe PACKAGES packages
}

# vim: set ft=zsh:
