From 6e97296e2571595871bdd55147c627fd234fdcf4 Mon Sep 17 00:00:00 2001 From: levasseur Date: Tue, 1 Jun 2021 15:07:49 +0200 Subject: [PATCH] lib/display.sh: some cosmetics improvement --- lib/display.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/display.sh b/lib/display.sh index d2e44d2..33d1a36 100644 --- a/lib/display.sh +++ b/lib/display.sh @@ -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