Commit c8951fab authored by Emeric Verschuur's avatar Emeric Verschuur

warn/err function update

parent 09198545
Pipeline #59 passed with stage
in 36 seconds
......@@ -19,7 +19,7 @@
set -e
function bashopts_exit_handle() {
bashopts_exit_handle() {
local err=$?
set +o xtrace
local code="${1:-1}"
......@@ -46,30 +46,18 @@ set -o errtrace
# display a error (fatal)
bashopts_critical() {
local l
>&2 echo -n "[ERROR] "
for l in "$@"; do
>&2 echo -e "$l"
done
>&2 printf "[ERROR] %s\n" "$@"
exit 1
}
# display a error (non fatal)
bashopts_error() {
local l
>&2 echo -n "[ERROR] "
for l in "$@"; do
>&2 echo -e "$l"
done
>&2 printf "[ERROR] %s\n" "$@"
}
# display a warning (non fatal)
bashopts_warning() {
local l
>&2 echo -n "[WARNING] "
for l in "$@"; do
>&2 echo -e "$l"
done
>&2 printf "[WARNING] %s\n" "$@"
}
bashopts_regex_escape () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment