aboutsummaryrefslogtreecommitdiff
path: root/completion/zsh.patch
blob: adf7eddcca1bbd998f5d78e5b68b5aeb66c00a21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
-}