Set cache-policy before calling _arguments

This commit is contained in:
Aljaž "g5pw" Srebrnič 2013-03-31 23:29:55 +02:00
parent 810840e0e0
commit 54ed122d25
1 changed files with 6 additions and 6 deletions

View File

@ -48,6 +48,12 @@ _port() {
'--show:Show which version is currently selected for the group (default if none given)' '--show:Show which version is currently selected for the group (default if none given)'
) )
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _port_caching_policy
fi
_arguments -s -C \ _arguments -s -C \
'-v[verbose mode (generate verbose messages)]' \ '-v[verbose mode (generate verbose messages)]' \
'-d[debug mode (generate debugging messages, implies -v)]' \ '-d[debug mode (generate debugging messages, implies -v)]' \
@ -70,12 +76,6 @@ _port() {
'*:extra:->extra' \ '*:extra:->extra' \
&& return 0 && return 0
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _port_caching_policy
fi
case "$state" in case "$state" in
extra) extra)
case "$words[2]" in case "$words[2]" in