From 4b07b34b80ecbf8cfb88945a56ce021525b74741 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sat, 5 May 2018 15:52:23 +0300 Subject: Add patches for pacman completions from git --- completion/zsh-git.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 completion/zsh-git.patch (limited to 'completion/zsh-git.patch') diff --git a/completion/zsh-git.patch b/completion/zsh-git.patch new file mode 100644 index 0000000..adf7edd --- /dev/null +++ b/completion/zsh-git.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=($(pacman-conf --repo-list)) ++ repositories=($(pacman-conf --repo-list) 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 +-} -- cgit v1.2.3-70-g09d2