Created
January 14, 2023 00:57
-
-
Save tsibley/47c7694724fe86003a2ad778ebb585d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=sh : | |
__BASHDB_SOURCE="$BASH_SOURCE" | |
__bashdb:trap() { | |
local file="$1" line="$2" fn="$3" cmd="$4" | |
echo "→ $file:$line:$fn: $cmd" >&2 | |
# From here we can return: | |
# 0 to continue | |
# 1 to skip cmd | |
# 2 to return from fn | |
# XXX example | |
if [[ "$file:$fn" == simple:f ]]; then | |
return 2 | |
fi | |
return 0 | |
} | |
trap '__bashdb:trap "$BASH_SOURCE" "$LINENO" "$FUNCNAME" "$BASH_COMMAND"' DEBUG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment