From b004f3b7137ced340c0f5a1229b47001482160da Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: May 11 2011 03:17:55 +0000 Subject: Start using `--as-stdout-line' of cli_printMessage to print out the option value retrived from render_getConfigOption. - This is required in order for render_getConfigOption to output the correct apostrophe character in the output; for those cases where the apostrophe is passed as an option argument (e.g., `--comment="You've been there."'). Otherwise the codified value would be printed out instead (e.g., `You027ve been there.'). - The apostrophe codification is required in order to allow spaces in option arguments. Otherwise, the option argument might be cut wherever the first uncodified apstrophe be in the option argument. --- diff --git a/Scripts/Functions/Render/render_getConfigOption.sh b/Scripts/Functions/Render/render_getConfigOption.sh index 72657bd..4d0a4c5 100755 --- a/Scripts/Functions/Render/render_getConfigOption.sh +++ b/Scripts/Functions/Render/render_getConfigOption.sh @@ -70,6 +70,6 @@ function render_getConfigOption { | sed -r 's! *$!!g') # Output action value without trailing newline. - echo -n "$VALUE" + cli_printMessage "$VALUE" --as-stdout-line } diff --git a/Scripts/Functions/cli_printMessage.sh b/Scripts/Functions/cli_printMessage.sh index 66cf3d6..03dd277 100755 --- a/Scripts/Functions/cli_printMessage.sh +++ b/Scripts/Functions/cli_printMessage.sh @@ -35,7 +35,7 @@ function cli_printMessage { local ARGSS='' # Define long options. - local ARGSL='message:,as-separator-line,as-banner-line,as-updating-line,as-cropping-line,as-tuningup-line,as-deleting-line,as-checking-line,as-creating-line,as-reading-line,as-savedas-line,as-linkto-line,as-movedto-line,as-translation-line,as-design-line,as-configuration-line,as-palette-line,as-response-line,as-request-line,as-error-line,as-toknowmore-line,as-yesornorequest-line,as-notrailingnew-line,as-regular-line,' + local ARGSL='message:,as-separator-line,as-banner-line,as-updating-line,as-cropping-line,as-tuningup-line,as-deleting-line,as-checking-line,as-creating-line,as-reading-line,as-savedas-line,as-linkto-line,as-movedto-line,as-translation-line,as-design-line,as-configuration-line,as-palette-line,as-response-line,as-request-line,as-error-line,as-toknowmore-line,as-yesornorequest-line,as-notrailingnew-line,as-stdout-line,' # Initialize arguments with an empty value and set it as local # variable to this function scope. @@ -260,7 +260,13 @@ function cli_printMessage { break ;; - --as-regular-line | * ) + --as-stdout-line ) + echo "$MESSAGE" + shift 2 + break + ;; + + * ) echo "$MESSAGE" \ | awk 'BEGIN { FS=": " } {