diff --git a/src/_pactree b/src/_pactree new file mode 100644 index 0000000..3a5cc36 --- /dev/null +++ b/src/_pactree @@ -0,0 +1,14 @@ +#compdef pactree pactree.static=pactree + +# copy this file to /usr/share/zsh/site-functions/_pactree +typeset -A opt_args + +_pactree() { + local -a cmd packages packages_long + packages_long=(/var/lib/pacman/local/*(/)) + packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} ) + compadd "$@" -a packages +} + +# run the main dispatcher +_pactree "$@"