Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Better ERR_EXIT and ERR_RETURN documentation
- X-seq: zsh-workers 51194
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Better ERR_EXIT and ERR_RETURN documentation
- Date: Mon, 12 Dec 2022 08:21:51 -0800
- Archived-at: <https://zsh.org/workers/51194>
- In-reply-to: <CAGdYchuFZb17c+_iwNc_uVp+_0sVibU9=JUMzGOPQ2ahUCPbew@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchuFZb17c+_iwNc_uVp+_0sVibU9=JUMzGOPQ2ahUCPbew@mail.gmail.com>
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