1 |
On Sat, Apr 16, 2022 at 06:48:56AM -0400, Ionen Wolkens wrote: |
2 |
> On Sat, Apr 16, 2022 at 12:23:18PM +0200, Florian Schmaus wrote: |
3 |
> > > ebegin "Running $@" |
4 |
> > > "$@" |
5 |
> > > eend $? || die -n "$@ failed" > return $? |
6 |
> > |
7 |
> > I think this return statement can be omitted since it will always be |
8 |
> > invoked with 0 as argument, and this is the default behavior of implicit |
9 |
> > function return (IIRC). |
10 |
> |
11 |
> Not with nonfatal (die is using -n to allow it) |
12 |
> |
13 |
> nonfatal edo false || echo "different error handling: $?" |
14 |
> |
15 |
> Without return $?, the above will echo 0 or 1 if die was triggered |
16 |
> but (with current implementation) won't be the actual return code. |
17 |
|
18 |
Err wait, return $? won't help with that, need a temporary variable |
19 |
to preserve. |
20 |
|
21 |
return $? indeed does nothing here :) |
22 |
|
23 |
-- |
24 |
ionen |