summaryrefslogtreecommitdiff
path: root/zsh_completion.in
blob: 51a023bf14913be98349541c36903b044eeca9e3 (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
#compdef archbuild finddeps makechrootpkg mkarchroot

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

_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]'
	'-d[Add the package to a local db at /repo after 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=(
	'-r[Run a program within the context of the chroot]:app'
	'-u[Update the chroot via pacman]'
	'-f[Force overwrite of files in the working-dir]'
	'-C[Location of a pacman config file]:pacman_config:_files'
	'-M[Location of a makepkg config file]:makepkg_config:_files'
	'-n[Do not copy config files into the chroot]'
	'-c[Set pacman cache]:pacman_cache:_files -/'
	'-h[Display usage]'
)

_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