|
|
@ -12,6 +12,9 @@ function is_true { |
|
|
[[ "${1:-}" == 'true' ]] |
|
|
[[ "${1:-}" == 'true' ]] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# FIXME: define an alias to bypass ARG evaluation when unnecessary! |
|
|
|
|
|
# example: |
|
|
|
|
|
# alias toto="bash -c \"[[ \\\$MIAOU_DEBUG == 'true' ]] && echo yes || echo nope\"" |
|
|
function miaou_debug { |
|
|
function miaou_debug { |
|
|
is_true "${MIAOU_DEBUG}" && >/dev/tty builtin echo -e "\r\e[90mDEBUG <==> \e[95m$*\e[0m" || true |
|
|
is_true "${MIAOU_DEBUG}" && >/dev/tty builtin echo -e "\r\e[90mDEBUG <==> \e[95m$*\e[0m" || true |
|
|
} |
|
|
} |
|
|
@ -30,7 +33,8 @@ function on_error { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function dump_stderr { |
|
|
function dump_stderr { |
|
|
>&2 printf '' # flush |
|
|
|
|
|
|
|
|
>&2 printf '' # force flush |
|
|
|
|
|
|
|
|
miaou_debug --stderr-- |
|
|
miaou_debug --stderr-- |
|
|
mapfile -t tmp_error <"$MIAOU_BASH_ERROR" |
|
|
mapfile -t tmp_error <"$MIAOU_BASH_ERROR" |
|
|
for i in "${tmp_error[@]}"; do >&4 echo -e "$i"; done |
|
|
for i in "${tmp_error[@]}"; do >&4 echo -e "$i"; done |
|
|
|