1 |
On Sat, Apr 16, 2022 at 12:23:18PM +0200, Florian Schmaus wrote: |
2 |
> > ebegin "Running $@" |
3 |
> > "$@" |
4 |
> > eend $? || die -n "$@ failed" > return $? |
5 |
> |
6 |
> I think this return statement can be omitted since it will always be |
7 |
> invoked with 0 as argument, and this is the default behavior of implicit |
8 |
> function return (IIRC). |
9 |
|
10 |
Not with nonfatal (die is using -n to allow it) |
11 |
|
12 |
nonfatal edo false || echo "different error handling: $?" |
13 |
|
14 |
Without return $?, the above will echo 0 or 1 if die was triggered |
15 |
but (with current implementation) won't be the actual return code. |
16 |
|
17 |
That still mostly work but maybe, e.g. the code need to check if |
18 |
grep returned 2 (aka error) while 1 isn't an error but just didn't |
19 |
match anything. |
20 |
|
21 |
-- |
22 |
ionen |