Commit 2f1ef4d9 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

beautify error output

Also: tag error messages as systemd error messages when the messages are
not directed to the terminal.
parent 7c432946
......@@ -15,7 +15,12 @@ report_notice() {
}
report_error() {
echo "$*"
local prefix="<3>" suffix=""
if [[ -t 2 ]]; then
prefix=$(tput bold; tput setaf 1)
suffix=$(tput sgr0)
fi
echo "$prefix$*$suffix" >&2
}
report_debug() {
......@@ -23,7 +28,7 @@ report_debug() {
}
exit_error() {
report_error "$@" >&2
report_error "$@"
exit 1
}
......
Supports Markdown
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