disp(): fixed display of the first parameter not being part of the message

This commit is contained in:
2022-11-18 14:07:41 +01:00
parent d7e6d81126
commit 5b9d7a983e

View File

@@ -84,18 +84,22 @@ disp()
case $1 in
"I")
local heads="[ ${IGreen}info${DEFAULTFG} ]"
shift
[[ -z $QUIET || $QUIET -ne 1 ]] && echo -e "${heads} $@"
;;
"W")
local heads="[ ${IYellow}Warning${DEFAULTFG} ]"
shift
echo -e "${heads} $@" >&2
;;
"E")
local heads="[ ${IRed}ERROR${DEFAULTFG} ]"
shift
echo -e "${heads} $@" >&2
;;
"D")
local heads"[ ${ICyan}debug${DEFAULTFG} ]"
shift
[[ -n $DEBUG && $DEBUG -gt 1 ]] && echo -e "${heads} $@"
;;
"*")
@@ -105,3 +109,4 @@ disp()
esac
unset heads
}
export -f disp