diff options
author | 2014-12-22 14:54:40 -0800 | |
---|---|---|
committer | 2014-12-22 14:54:40 -0800 | |
commit | 4a07d0a65ab3f4f8a23f396d63ecacee9e0cc257 (patch) | |
tree | 2fa8b55c1b75a260d09ae9dd701e7e2ca78b928c | |
parent | _gentoolkit: initial eshowkw completion support (diff) | |
download | zsh-completion-4a07d0a65ab3f4f8a23f396d63ecacee9e0cc257.tar.gz zsh-completion-4a07d0a65ab3f4f8a23f396d63ecacee9e0cc257.tar.bz2 zsh-completion-4a07d0a65ab3f4f8a23f396d63ecacee9e0cc257.zip |
_gentoolkit: add eshowkw completion support for comma-separated arch vals20150103
-rw-r--r-- | src/_gentoo_arches | 3 | ||||
-rw-r--r-- | src/_gentoolkit | 2 | ||||
-rw-r--r-- | src/_portage_utils | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/_gentoo_arches b/src/_gentoo_arches index 7206ea3..c5df979 100644 --- a/src/_gentoo_arches +++ b/src/_gentoo_arches @@ -6,6 +6,7 @@ arches=(${(f)"$(<$(_gentoo_repos -m)/profiles/arch.list)"}) for arch in $arches; do [[ $arch =~ '^[^#]' ]] && allarches+=( $arch ) done -_describe -t available-arches "arch" allarches + +echo "${allarches[@]}" # vim: ft=zsh sw=2 ts=2 et diff --git a/src/_gentoolkit b/src/_gentoolkit index b6a73b8..4d24688 100644 --- a/src/_gentoolkit +++ b/src/_gentoolkit @@ -308,7 +308,7 @@ _eshowkw () { _arguments -s \ '(: -)'{-h,--help}'[Display help and exit]' \ '(: -)'{-v,--version}'[Show package version and exit]' \ - {'(--arch)-a','(-a)--arch'}'[Display only specified arch(es)]:arch(es):_gentoo_arches' \ + {'(--arch)-a','(-a)--arch'}'[Display only specified arch(es)]:arch:_values -s , "arch" $(_gentoo_arches)' \ {'(--align)-A','(-A)--align'}'[Specify alignment for descriptions (default: bottom)]:alignment:((top bottom))' \ {'(--top-position)-T','(-T)--top-position'}'[Specify which fields we want to have in top listing (default: archlist)]:field:((archlist versionlist))' \ {'(--bold)-B','(-B)--bold'}'[Print out each other column in bold for easier visual separation]' \ diff --git a/src/_portage_utils b/src/_portage_utils index 3e483a6..4c41e16 100644 --- a/src/_portage_utils +++ b/src/_portage_utils @@ -19,6 +19,9 @@ case $service in {'(--compare)-c','(-c)--compare'}'[Compare two atoms]' ;; qcache) + local arches + arches=( $(_gentoo_arches) ) + _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' \ @@ -27,8 +30,9 @@ case $service in {'(--testing)-t','(-t)--testing'}'[list packages that have ~arch versions, but no stable versions on a given arch]' \ {'(--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:_gentoo_arches' + {'(--not)-n','(-n)--not'}"[list packages that aren't keyworded on a given arch]" + + _describe -t available-arches "arch" arches ;; qcheck) _arguments -s $common_args \ |