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 14c467a764
commit da20b17526

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"