Set cache-policy before calling _arguments
This commit is contained in:
parent
810840e0e0
commit
54ed122d25
12
src/_port
12
src/_port
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue