From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F1990138ACE for ; Sun, 21 Dec 2014 09:51:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D0661E0A03; Sun, 21 Dec 2014 09:51:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6B746E0A03 for ; Sun, 21 Dec 2014 09:51:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7E94E34062F for ; Sun, 21 Dec 2014 09:51:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 26A5FCFD5 for ; Sun, 21 Dec 2014 09:51:03 +0000 (UTC) From: "Tim Harder" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tim Harder" Message-ID: <1419154386.14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c.radhermit@gentoo> Subject: [gentoo-commits] proj/zsh-completion:master commit in: src/ X-VCS-Repository: proj/zsh-completion X-VCS-Files: src/_gentoo_arches src/_portage_utils X-VCS-Directories: src/ X-VCS-Committer: radhermit X-VCS-Committer-Name: Tim Harder X-VCS-Revision: 14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c X-VCS-Branch: master Date: Sun, 21 Dec 2014 09:51:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bb96b367-2f72-4951-8d96-f9cf31379be2 X-Archives-Hash: 5d1fb4867790314a5e456ed9a7df59e9 commit: 14ad3adb3606e7d7f7d538ae8f7cda2f8b11d93c Author: Tim Harder gentoo org> AuthorDate: Sun Dec 21 09:33:06 2014 +0000 Commit: Tim Harder gentoo org> CommitDate: Sun Dec 21 09:33:06 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=14ad3adb 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. --- src/_gentoo_arches | 11 +++++++++++ src/_portage_utils | 13 +------------ 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 \