[pacman] Remove dependency from completion module

The completion module has specific code for the pacman module, and we
want to make modules independent from each other.

Plus, as far as I checked, most of the pacman wrappers/frontends are
already packaged with zsh completion out of the box. I'm not an Arch
user, but I checked the repos of the ones in
https://wiki.archlinux.org/index.php/AUR_helpers#Pacman_wrappers and
these contain zsh completion scripts:

* aura: https://github.com/aurapm/aura/blob/master/aura/doc/completions/_aura
* pacaur: https://github.com/rmarquis/pacaur/blob/master/zsh.completion
* pakku: https://github.com/kitsunyan/pakku/blob/master/completion/zsh.patch
* pikaur: https://github.com/actionless/pikaur/blob/master/packaging/usr/share/zsh/site-functions/_pikaur
* trizen: https://github.com/trizen/trizen/blob/master/zsh.completion
* yay: https://github.com/Jguer/yay/blob/master/completions/zsh

I didn't find zsh completions for the ones listed below, so I added a
compdef function for them inside the pacman module itself:

* aurman
* packer-aur
* wrapaur
* yaourt

Closes #296
This commit is contained in:
Eric Nielsen 2018-10-01 08:17:22 -05:00 committed by GitHub
parent e5639c8fa7
commit 35c5daf791
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 17 deletions

View file

@ -1,14 +0,0 @@
#
# Alias compdefs
#
# Any aliased commands will not function with completion without compdefs.
# Because completion is the LAST module to be loaded (so we make sure to catch all completions)
# we must assign the compdefs here, as opposed to within the modules themselves.
# Unfortunately, I'm not aware of a worthwhile way to ensure that these will be included in .zcompdump
# zpacman_frontend -> pacman
if (( ${+zpacman_frontend} )); then
compdef ${zpacman_frontend}='pacman'
fi

View file

@ -18,9 +18,6 @@ fpath=(${0:h}/external/src ${fpath})
# load and initialize the completion system # load and initialize the completion system
autoload -Uz compinit && compinit -C -d "${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}" autoload -Uz compinit && compinit -C -d "${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}"
# set any compdefs
source ${0:h}/compdefs.zsh
# #
# zsh options # zsh options

View file

@ -0,0 +1,3 @@
#compdef aurman packer wrapaur yaourt
service=pacman; _pacman