diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-10-07 15:02:33 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-10-07 15:02:33 (EDT) |
commit | 5393e50727c29bd29c4461019e2b426f701a88c5 (patch) | |
tree | 3e074ffb7275681881fde20a1b1b3eeb9d42b27e | |
parent | 52f8fdf72b5967308771ec1021e565115474a88e (diff) |
error(): Die by signal
Calling error() within a subshell will now kill the whole shell process.
More importantly, session_end() will now be called if we've started a
session.
-rw-r--r-- | lib/output.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/output.sh b/lib/output.sh index ffe982d..877c7fc 100644 --- a/lib/output.sh +++ b/lib/output.sh @@ -30,7 +30,10 @@ error() printf '%s: Error: ' "${0##*/}" >&2 printf "${fmt}\n" "${@}" >&2 - exit ${status} + # In a subshell, this will have no effect, so the shell's exit status + # will be 128+SIGINT. Meh. + exit_status=${status} + kill -s INT ${$} } warn() |