Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib/completion/zsh/_devtools.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/completion/zsh/_devtools.in')
-rw-r--r--contrib/completion/zsh/_devtools.in40
1 files changed, 38 insertions, 2 deletions
diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in
index 707e3fa..1dc112f 100644
--- a/contrib/completion/zsh/_devtools.in
+++ b/contrib/completion/zsh/_devtools.in
@@ -15,10 +15,24 @@ _archbuild_args=(
'--[Introduce makechrootpkg options]:*::makechrootpkg options:= _dispatch makechrootpkg makechrootpkg'
)
-_archco_args=(
+_archco_cmds=(
+ "archco command"
+ "clone[Clone a package repository]"
+ "configure[Configure a clone according to distro specs]"
+)
+
+_archco_clone_args=(
+ '(-u --unprivileged)'{-u,--unprivileged}'[Read-only access without packager info as Git author]'
+ '(-h --help)'{-h,--help}'[Display usage]'
'*:packages:_devtools_completions_all_packages'
)
+_archco_configure_args=(
+ '(-u --unprivileged)'{-u,--unprivileged}'[Configure read-only repo without packager info as Git author]'
+ '(-h --help)'{-h,--help}'[Display usage]'
+ '*:git_dir:_files -/'
+)
+
_arch_nspawn_args=(
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
@@ -128,8 +142,30 @@ _devtools_completions_all_packages() {
}
_devtools() {
- local argname="_${service//-/_}_args[@]"
+ local service_func=_${service//-/_}
+ local service_cmds=${service_func}_cmds
+ if typeset -p ${service_cmds} &> /dev/null; then
+ _arguments -C \
+ "1: :->cmds" \
+ '*::arg:->args'
+ case $state in
+ cmds)
+ local service_cmds_array=${service_cmds}[@]
+ _values "${(P)service_cmds_array}"
+ ;;
+ args)
+ local cmd_args_array=${service_func}_$line[1]_args
+ if typeset -p ${cmd_args_array} &> /dev/null; then
+ local cmd_args=${cmd_args_array}[@]
+ _arguments -s "${(P)cmd_args}"
+ fi
+ ;;
+ esac
+ return 0
+ fi
+ local argname="${service_func}_args[@]"
_arguments -s "${(P)argname}"
+
}
_devtools