From 62aed8ded6e0bb643a9dd6350558ffc23aae3c46 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 22 Jul 2019 15:58:00 -0400 Subject: [PATCH] better docs --- err | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/err b/err index 1425306..580183c 100644 --- a/err +++ b/err @@ -20,22 +20,17 @@ # runs err-catch. See the README file for a slightly longer explanation. -####################################### -# Undoes err-catch. turns off exit and stack trace on error. -####################################### -err-allow() { - set +E +o pipefail; trap ERR -} - - ####################################### # Print stack trace # # usage: err-bash-trace [FRAME_START] # +# This function is called by the other functions which print stack +# traces. +# # It does not show function args unless you first run: # shopt -s extdebug -# which err-catch & err-print does for you. +# which err-catch & err-print do for you. # # FRAME_START The frame to start printing on. default=0. Useful when # printing from an ERR trap function to avoid printing @@ -91,6 +86,13 @@ err-catch() { set -o pipefail } +####################################### +# Undoes err-catch. turns off exit and stack trace on error. +####################################### +err-allow() { + set +E +o pipefail; trap ERR +} + ####################################### # On error, print stack trace ####################################### @@ -113,7 +115,7 @@ err-print() { ####################################### -# On error, print stack trace +# Print stack trace and exit # # Use this instead of the exit command to be more informative. # -- 2.25.1