lib/utils: Simplify "_omb_log_die"

This commit is contained in:
Jacob Hrbek 2021-12-28 14:26:00 +02:00 committed by Koichi Murase
parent 29bcd14fa3
commit 71b2d2ee52

View File

@ -242,16 +242,7 @@ _omb_util_command_exists _omb_log_note ||
_omb_util_command_exists _omb_log_info ||
function _omb_log_info { printf "INFO: %s\n" "$1"; }
_omb_util_command_exists _omb_log_die ||
function _omb_log_die {
local status=$1
case $status in
1) printf 'FATAL: %s\n' "$2"
exit "$status" ;;
*) printf 'FATAL: Syntax error%s\n%s\n' "${FUNCNAME:+ in $FUNCNAME}" "$2"
((status)) && printf 'FATAL: %s\n' "$status"
return "$status" ;;
esac
}
function _omb_log_die { printf 'FATAL: %s\n' "$2"; exit "$1"; }
#
# USAGE FOR SEEKING CONFIRMATION