mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-17 16:00:19 +00:00
Set cache-policy before calling _arguments
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user