Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Safety guards for typos



On 2022-01-24 at 02:46 +0100, Mikael Magnusson wrote:
> setopt NO_MULTI_FUNC_DEF would probably do the trick in this case,
> though it will also prevent explicitly saying mv cp ln() { whatever }.

I tried it and the protection doesn't appear to fire.  Is it possible
that the examination of multiple words before the function definition
happens prior to globbing expansion?

% echo $ZSH_VERSION
5.8
% echo ${options[multifuncdef]}
off
% *() { echo wibble }
% whence -vfa zshenv zshrc
zshenv () {
	echo wibble
}
zshrc () {
	echo wibble
}
%

-Phil




Messages sorted by: Reverse Date, Date, Thread, Author