Zsh 自动加载中的 -U 选项的用途是什么

What is the purpose of the -U option in Zsh's autoload

zsh 的手册页提到 autoload 命令的一个选项 -U,但没有解释。但是,它指的是 functions 命令的无法解释的选项。在手册页中查找 functions,我看到它确实接受 -U,但也没有解释。

在网络上的示例中,我有时看到 autoload-U 一起使用,有时不与 -U 一起使用。这个选项是做什么的,它在哪里解释?说明应该在 zsh 手册页的某处,但我找不到。

autoload 等价于 functions -ufunctions 又等价于 typeset -f.

如果您在 zshbuiltins(1) 手册页中查找有关 typeset 的部分,您最终会找到答案:

The -u and -U flags cause the function to be marked for autoloading; -U also causes alias expansion to be suppressed when the function is loaded.