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