mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-12-02 05:58:43 +08:00
Set cache-policy before calling _arguments
This commit is contained in:
1 parent
810840e0e0
commit
54ed122d25
1 file changed
+6
-6
@@ -48,6 +48,12 @@ _port() {
|
||||
'--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 \
|
||||
'-v[verbose mode (generate verbose messages)]' \
|
||||
'-d[debug mode (generate debugging messages, implies -v)]' \
|
||||
@@ -70,12 +76,6 @@ _port() {
|
||||
'*:extra:->extra' \
|
||||
&& 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
|
||||
extra)
|
||||
case "$words[2]" in
|
||||
|
||||
Reference in new issue
Block a user