Add 'die' function

Candidate replacement of multiple instances of the same error
handling sequence.
This commit is contained in:
dacav 2025-04-22 23:31:53 +02:00 committed by Ritchie Cunningham
parent e8e8080e08
commit e4602aeeec

9
imgbb
View File

@ -62,6 +62,15 @@ print_usage() {
echo " -h, --help Show this help message."
}
die() {
declare msg
msg="$*"
notify_cmd -u critical "ImgBB Upload Error" "$msg" &>/dev/null
echo "$msg" >&2
exit 1
}
# Parse command-line options.
while [[ $# -gt 0 ]]; do
key="$1"