aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2014-12-21 01:33:06 -0800
committerTim Harder <radhermit@gentoo.org>2014-12-21 01:33:06 -0800
commit14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c (patch)
treec584c938622968ac5536cfc41bf8d7f2a0baf2fd /src
parentuse reStructuredText for the readme (diff)
downloadzsh-completion-14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c.tar.gz
zsh-completion-14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c.tar.bz2
zsh-completion-14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c.zip
split out arches list into it's own completion file
This might be combined later on with _gentoo_repos to form a _gentoo file that accepts command args related to the completion function requested.
Diffstat (limited to 'src')
-rw-r--r--src/_gentoo_arches11
-rw-r--r--src/_portage_utils13
2 files changed, 12 insertions, 12 deletions
diff --git a/src/_gentoo_arches b/src/_gentoo_arches
new file mode 100644
index 0000000..7206ea3
--- /dev/null
+++ b/src/_gentoo_arches
@@ -0,0 +1,11 @@
+#autoload
+
+local arches arch allarches
+
+arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
+for arch in $arches; do
+ [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
+done
+_describe -t available-arches "arch" allarches
+
+# vim: ft=zsh sw=2 ts=2 et
diff --git a/src/_portage_utils b/src/_portage_utils
index cab73f9..3e483a6 100644
--- a/src/_portage_utils
+++ b/src/_portage_utils
@@ -19,17 +19,6 @@ case $service in
{'(--compare)-c','(-c)--compare'}'[Compare two atoms]'
;;
qcache)
- local arch
- local -a arches allarches
-
- show_archs(){
- arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"})
- for arch in $arches; do
- [[ $arch =~ '^[^#]' ]] && allarches+=( $arch )
- done
- _describe -t available-arches "arch" allarches
- }
-
_arguments -s $common_args \
{'(--matchpkg)-p','(-p)--matchpkg'}'[match pkgname]:package name:_gentoo_packages available_pkgnames_only' \
{'(--matchcat)-c','(-c)--matchcat'}'[match catname]:category:_gentoo_packages category' \
@@ -39,7 +28,7 @@ case $service in
{'(--stats)-s','(-s)--stats'}'[display statistics about the portage tree]' \
{'(--all)-a','(-a)--all'}'[list packages that have at least one version keyworded for on a given arch]' \
{'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" \
- '*:arch:show_archs'
+ '*:arch:_gentoo_arches'
;;
qcheck)
_arguments -s $common_args \