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

Re: PATCH: minor module tweak



On Mar 23,  2:18pm, Peter Stephenson wrote:
}
} While playing about with zmodload I noted that a failed zmodload
} doesn't flag an error, so you can use it as a test for module
} availability.  I've interpreted this as a feature and documented it.

It's certainly been used this way ever since the -i flag was added;
e.g. in zfinit:  zmodload -i zsh/net/tcp || return 1

So it's fine that you documented this, but I think it was implicit all
along in the phrase "prints an error message and returns a non-zero
status."  (If it were going to abort the code block, it couldn't return
a status, could it?)

There are a few places in Functions/**/*(.) where the "|| return 1"
could helpfully to be appended to a "zmodload -i" that currently just
assumes it will succeed.



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