edoc feature request

Richard Carlsson richardc@REDACTED
Thu Feb 2 10:00:55 CET 2006


Fredrik Thulin wrote:
> I would vote for just making edoc return non-zero on error (like you
> suggested) by default. Always.
>
> Since, as far as I understand your original problem description, there
> hasn't been any difference in the exit code of the edoc beam process
> there can't be any scripts that depend on it today, so backwards
> compatibility is not an issue.

The main snag seems to be that if I use halt(NonZero), the emulator
is often in such a hurry to quit that not all I/O has time to finish,
which means that you might not see the message explaining what the
problem was. So it was a design decision to not use halt, but instead
rely on the final "-s init stop" in the command-line invocation.

Sadly, there is no init:stop/1 which could be used to terminate nicely
*and* return an exit code. It would be pretty trivial to add (if OTP
would accept it), but that would not solve the problem for edoc until
the next release of OTP (and assuming that all users switch to the
new system).

I could add a small delay before calling halt(NonZero) upon errors,
if that's the only other way out of the problem. It's not a pretty
solution, but what the heck.

If anybody knows a good way to shut down the system nicely but as
quick as possible and with a particular exit code, please let me know.

> If there _are_ scripts/makefiles that check the exit status already, I
> bet they all think edoc exits with a non-zero exit value on errors.

Probably. It would be nice if it worked, too.

	/Richard

-- 
 "Having users is like optimization: the wise course is to delay it."
   -- Paul Graham



More information about the erlang-questions mailing list