ShellPkg: Update 'echo' command to print everything at once. this allows for format color coding on the output.

signed-off-by: jcarsey
reviewed-by: darylm503

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12969 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2012-01-30 22:48:33 +00:00
parent 94753eb940
commit eefe286b7b
1 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/** @file
Main file for Echo shell level 3 function.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -40,8 +40,12 @@ ShellCommandRunEcho (
SHELL_STATUS ShellStatus;
UINTN ParamCount;
CHAR16 *ProblemParam;
UINTN Size;
CHAR16 *PrintString;
Size = 0;
ProblemParam = NULL;
PrintString = NULL;
ShellStatus = SHELL_SUCCESS;
//
@ -96,13 +100,13 @@ ShellCommandRunEcho (
; ShellCommandLineGetRawValue(Package, ParamCount) != NULL
; ParamCount++
) {
StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0);
if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) {
ShellPrintEx(-1, -1, L"%s ", ShellCommandLineGetRawValue(Package, ParamCount));
} else {
ShellPrintEx(-1, -1, L"%s", ShellCommandLineGetRawValue(Package, ParamCount));
}
StrnCatGrow(&PrintString, &Size, L" ", 0);
}
}
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel3HiiHandle);
ShellPrintEx(-1, -1, L"%s\r\n", PrintString);
SHELL_FREE_NON_NULL(PrintString);
}
//