Skip to content

Commit

Permalink
lib/utils: Simplify "_omb_log_die"
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyren authored and akinomyoga committed Jan 8, 2022
1 parent a0a7dbc commit ffaf054
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,7 @@ _omb_util_command_exists _omb_log_note ||
_omb_util_command_exists _omb_log_info ||
_omb_log_info() { printf "INFO: %s\n" "$1"; }
_omb_util_command_exists _omb_log_die ||
_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
}
_omb_log_die() { printf 'FATAL: %s\n' "$2"; exit "$1"; }

#
# USAGE FOR SEEKING CONFIRMATION
Expand Down

0 comments on commit ffaf054

Please sign in to comment.