From 93aa263b40fe3f3a164d1219048006b49af72d8d Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 5 Jun 2019 14:25:00 +0200 Subject: [PATCH] Autocompletion for pactree --- zsh/.config/zsh/completions/_pactree | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 zsh/.config/zsh/completions/_pactree diff --git a/zsh/.config/zsh/completions/_pactree b/zsh/.config/zsh/completions/_pactree new file mode 100644 index 0000000..e46af4f --- /dev/null +++ b/zsh/.config/zsh/completions/_pactree @@ -0,0 +1,24 @@ +#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: