The man page for zsh mentions for the autoload
command an option -U
, but doesn't explain it. However, it refers for unexplain options to the functions
command. Looking up functions
in the man page, I see that it indeed accepts -U
, but it isn't explained either.
In examples on the Net, I sometimes see autoload
used with and sometimes without -U
. What is this option doing, and where is it explained? The explanation must be somewhere in the zsh man pages, but I couldn't find it.
autoload
is equivalent to functions -u
, and functions
is in turn equivalent to typeset -f
.
If you look up the section on typeset
in the zshbuiltins(1)
man page, you'll finally find your answer:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.