aboutsummaryrefslogtreecommitdiff
path: root/completion/zsh.patch
diff options
context:
space:
mode:
authorkitsunyan2018-05-05 03:51:07 +0000
committerkitsunyan2018-05-05 03:51:07 +0000
commitdbe10af0544069641f48cee263717eff68dee07e (patch)
tree45c2f6d7b9394235df634aa423978b780c750d54 /completion/zsh.patch
parent5902c51fe5b81ec6e8651eb2d29255ec6b9659fa (diff)
Add zsh completion
Diffstat (limited to 'completion/zsh.patch')
-rw-r--r--completion/zsh.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/completion/zsh.patch b/completion/zsh.patch
new file mode 100644
index 0000000..c3eb8c9
--- /dev/null
+++ b/completion/zsh.patch
@@ -0,0 +1,50 @@
+--- a/zsh
++++ b/zsh
+@@ -1,1 +1,1 @@
+-#compdef pacman pacman.static=pacman pacman-key makepkg
++#compdef pakku
+@@ -139,2 +139,6 @@
+ '--print-format[Specify how the targets should be printed]'
++ {-n,--build}'[Build targets from source]'
++ '--keyserver[Keyserver to receive keys from]'
++ '--noaur[Disable all AUR operations]'
++ {-z,--source}'[Retrieve PKGBUILD source]'
+ )
+@@ -310,1 +314,6 @@
+- packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
++ if [[ ${words[CURRENT]%/*} == 'aur' ]]; then
++ packages=( $(_call_program packages $cmd[@] -Ss ${words[CURRENT]#*/} |
++ grep -Po '(?<=^aur/)[^ ]+') )
++ else
++ packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
++ fi
+@@ -314,1 +323,1 @@
+- packages=( $(_call_program packages $cmd[@] -Sql) )
++ packages=( $(_call_program packages $cmd[@] -Ssq ${words[CURRENT]}) )
+@@ -318,1 +327,1 @@
+- repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
++ repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options} aur)
+@@ -361,1 +370,1 @@
+- cmd=( "pacman" "2>/dev/null")
++ cmd=("pakku" "2>/dev/null")
+@@ -371,1 +380,1 @@
+-_pakku_zsh_comp() {
++_pakku_comp() {
+@@ -501,17 +510,0 @@
+-
+-_pakku_comp() {
+- case "$service" in
+- makepkg)
+- _makepkg "$@"
+- ;;
+- pacman-key)
+- _pakku_key "$@"
+- ;;
+- pacman)
+- _pakku_zsh_comp "$@"
+- ;;
+- *)
+- _message "Error"
+- ;;
+- esac
+-}