V9.14.002.2026.06.08
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -23,17 +23,21 @@ guard_sourcing || return "${ERR_GUARD_SOURCE}"
|
||||
# VAR_IN_DIALOG_WR
|
||||
# Arguments:
|
||||
# 1: Message to be printed.
|
||||
# 2: Optional exit code.
|
||||
#######################################
|
||||
arg_mismatch() {
|
||||
declare -i err_code="${2:-${ERR_ARG_MISMATCH}}"
|
||||
|
||||
### Call cleaner if and only if not in auto-install mode.
|
||||
if [[ "${VAR_AUTO_INSTALL}" == "false" ]]; then
|
||||
### Dynamically select the cleaner based on the dialog wrapper type.
|
||||
# shellcheck disable=SC2249
|
||||
case "${VAR_IN_DIALOG_WR}" in
|
||||
box|gauge) "dialog_${VAR_IN_DIALOG_WR}_cleaner" ;;
|
||||
esac
|
||||
fi
|
||||
printf "%b❌ Error: '%s'. %b%b" "${RED}" "${1}" "${RES}" "${NL}" >&2
|
||||
read -pr $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_ARG_MISMATCH}"
|
||||
read -rp $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${err_code}"
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user