From f09126bd903a5fa1658c1555402b6785692dac22 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Wed, 16 Aug 2023 17:46:16 +0000 Subject: [PATCH] Improve 'emake --quieter' * admin/emake: Improve the output when the --quieter option is used. --- admin/emake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/admin/emake b/admin/emake index 2badbe80358..c9e59d34067 100755 --- a/admin/emake +++ b/admin/emake @@ -138,14 +138,20 @@ The GNU allocators don't work|\ while read do C="" - (($NOCOLOR == 0)) && [[ "X${REPLY:0:1}" != "X " ]] && C="\033[1;31m" - (($NOCOLOR == 0)) && [[ "X${REPLY:0:3}" == "X " ]] && C="\033[1;31m" + E=0 + [ ! -v L ] && L=80 + [[ "X${REPLY:0:1}" != "X " ]] && E=1 + [[ "X${REPLY:0:3}" == "X " ]] && E=1 + (($NOCOLOR == 0)) && (($E == 1)) && C="\033[1;31m" + (($NOCOLOR == 0)) && (($E == 1)) && C="\033[1;31m" if (($QUIETER == 0)) then - [[ "X$C" == "X" ]] && printf "%s\n" "$REPLY" || printf "$C%s\033[0m\n" "$REPLY" + (($E == 0)) && printf "%s\n" "$REPLY" || printf "${C}%s\033[0m\n" "$REPLY" else - [[ "X$C" == "X" ]] && printf "%-80s\r" "$REPLY" || printf "$C%-80s\033[0m\n" "$REPLY" + (($E == 0)) && printf "%-${L}s\r" "$REPLY" || printf "${C}%-${L}s\033[0m\n" "$REPLY" fi + L=${#REPLY} + (($L < 80)) && L=80 done # If make failed, exit now with its error code. -- 2.39.2