lib/display.sh: some cosmetics improvement

This commit is contained in:
levasseur
2021-06-01 15:07:49 +02:00
parent 50f4f40eff
commit 6e97296e25

View File

@@ -1,4 +1,5 @@
# Defines color codes (standard 16 colors display)
# Some display functions and defines color codes
# (standard 16 colors display)
DEFAULTFG="\e[0;39m"
DEFAULTBG="\e[0;49m"
@@ -70,20 +71,20 @@ On_IWhite='\e[0;107m'
# Affiche le status avec en-tête coloré et timestamp
# (valeur de $1 : I=info, W=warning, E=error, pas d'entête si différent)
prnt() {
case $1 in
case $1 in
"I")
HEADS="[ ${IGreen}info${DEFAULTFG} ]"
shift
;;
HEADS="[ ${IGreen}info${DEFAULTFG} ]"
shift
;;
"W")
HEADS="[ ${IYellow}Attention${DEFAULTFG} ]"
shift
;;
HEADS="[ ${IYellow}Attention${DEFAULTFG} ]"
shift
;;
"E")
HEADS="[ ${IRed}ERREUR${DEFAULTFG} ]"
shift
;;
esac
echo -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${HEADS} $@"
HEADS="[ ${IRed}ERREUR${DEFAULTFG} ]"
shift
;;
esac
echo -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${HEADS} $@"
}
export -f prnt