From 35e7f821ca97f86a75a6a8d523020a3ca259374b Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jul 24 2011 14:09:13 +0000 Subject: Update `cli_printMessage.sh': - Reduce MESSAGE_WIDTH to 66 characters. This value is recommended in some documentations as the compromise for best reading without tiring the eyes. - Exclude `--as-stderr-line' from being limitted to MESSAGE_WIDTH. - Reorganize the way `--as-toknowmore-line' message is built. --- diff --git a/Scripts/Functions/cli_printMessage.sh b/Scripts/Functions/cli_printMessage.sh index fc44095..7c04bd5 100755 --- a/Scripts/Functions/cli_printMessage.sh +++ b/Scripts/Functions/cli_printMessage.sh @@ -41,7 +41,7 @@ function cli_printMessage { # Define message horizontal width. This is the max number of # horizontal characters the message will use to be displayed on # the screen. - local MESSAGE_WIDTH=75 + local MESSAGE_WIDTH=66 # Reverse the codification performed on characters that may affect # parsing options and non-option arguments. This codification is @@ -148,10 +148,10 @@ function cli_printMessage { # Define where the error was originated inside the # centos-art.sh script. Print out the function name and # line from the caller. - local ORIGIN="${CLI_PROGRAM} ($(caller 1 | gawk '{ print $2 " " $1 }'))" + local ORIGIN="$(caller 1 | gawk '{ print $2 " " $1 }')" # Build the error message. - cli_printMessage "${ORIGIN}: ${MESSAGE}" --as-stderr-line + cli_printMessage "${CLI_PROGRAM} (${ORIGIN}): $MESSAGE" --as-stderr-line cli_printMessage "${FUNCDIRNAM}" --as-toknowmore-line ;; @@ -207,7 +207,7 @@ function cli_printMessage { ;; --as-stderr-line ) - echo "$MESSAGE" | fmt --width=${MESSAGE_WIDTH} > /dev/stderr + echo "$MESSAGE" ;; * )