Browse Source

todo: exit stderr message

main
pvincent 1 week ago
parent
commit
151e4cb41b
  1. 4
      bin/bash-back
  2. 8
      lib/utility.bash

4
bin/bash-back

@ -20,6 +20,10 @@ function on_return {
# overridden function which permits stacktracing of original `return` statement # overridden function which permits stacktracing of original `return` statement
function exit { function exit {
code=${1:-0} code=${1:-0}
# TODO: prefer this output, but change the exit case scenario message in stacktrace first!
# >&2 echo "${BASH_SOURCE[2]}:${BASH_LINENO[0]} exit $@"
>&2 echo "${BASH_SOURCE[2]}: line ${BASH_LINENO[0]}: exit $@" >&2 echo "${BASH_SOURCE[2]}: line ${BASH_LINENO[0]}: exit $@"
builtin exit $code builtin exit $code
} }

8
lib/utility.bash

@ -4,10 +4,10 @@ function blabla {
} }
function suite { function suite {
# exit 0
return 7
exit 10 # youpi
exit
echo $nope echo $nope
exit 10
return
command_not_found command_not_found
return 7
return
} }
Loading…
Cancel
Save