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

Re: [PATCH] Better ERR_EXIT and ERR_RETURN documentation



On Mon, Dec 12, 2022 at 8:04 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
>> Except for the exceptions described below, the
>> logic is the same as that for tt(ERR_EXIT), except that an implicit
>> tt(return) statement is executed instead of an tt(exit).

That sentence is ... exceptional?  How about

  Except as explained below, an implicit tt(return) statement is
executed following the same logic described for tt(ERR_EXIT).

>> If tt(ERR_RETURN) and tt(ERR_EXIT) are both set, the latter takes
>> precedence. Hence, exit rather than return is triggered when a command
>> has a non-zero exit status.

Does this need to explain the interaction of the cases where ERR_EXIT
is ignored but ERR_RETURN is not?  As written it seems to imply that
exit would always occur in the cases where it would otherwise be a
return.




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