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