summaryrefslogtreecommitdiffstats
path: root/zsh_completion.in
blob: 0f95a4c112aa12f94c3dbb2b32ed31d25662fb10 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#compdef archbuild archco arch-nspawn archrelease archrm commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-i686-build=archbuild extra-x86_64-build=archbuild testing-i686-build=archbuild testing-x86_64-build=archbuild staging-i686-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-i686-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-i686-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco
# License: Unspecified

m4_include(lib/valid-tags.sh)

_archbuild_args=(
	'-c[Recreate the chroot before building]'
	'-r[Create chroots in this directory]:base_dir:_files -/'
)

_archco_args=(
	'*:packages:_devtools_completions_all_packages'
)

_arch_nspawn_args=(
	'-C[Location of a pacman config file]:pacman_config:_files'
	'-M[Location of a makepkg config file]:makepkg_config:_files'
	'-c[Set pacman cache]:pacman_cache:_files -/'
	'-h[Display usage]'
)

_archrelease_args=(
	"*:arch:($_tags[*])"
)

_archrm_args=(
	'1:path:_files -/'
)

_commitpkg_args=(
	"-a[Release to a specific architecture only]:arch:($_arch[*])"
	'-l[Set bandwidth limit]:limit'
	'1:commit_msg'
)

_finddeps_args=(
	'1:packages:_devtools_completions_all_packages'
)

_makechrootpkg_args=(
	'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
	'-c[Clean the chroot before building]'
	'-h[Display usage]'
	'-l[The directory to use as the working copy]:copy_dir:_files -/'
	'-r[The chroot dir to use]:chroot_dir:_files -/'
	'-u[Update the working copy of the chroot before building]'
)

_mkarchroot_args=(
	'-C[Location of a pacman config file]:pacman_config:_files'
	'-M[Location of a makepkg config file]:makepkg_config:_files'
	'-c[Set pacman cache]:pacman_cache:_files -/'
	'-h[Display usage]'
)

_rebuildpkgs_args=(
	'1:chroot_dir:_files -/'
	'*:packages:_devtools_completions_all_packages'
)

_devtools_completions_all_packages() {
	typeset -U packages
	packages=($(_call_program packages pacman -Sql))
	compadd - "${(@)packages}"
}

_devtools() {
	local argname="_${service//-/_}_args[@]"
	_arguments -s "${(P)argname}"
}

_devtools