summaryrefslogtreecommitdiff
path: root/edk2/ShellPkg/Application
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-09 16:33:58 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-09 16:33:58 +0000
commit13cab798a39ab397dc214e1354c1971cb64cad79 (patch)
tree6f5f948e97e883d6470c8d99a9a8641855fa7f09 /edk2/ShellPkg/Application
parentec74835d845ff24c02e529f308358dc0ae0d1305 (diff)
This adds support for @ prefixed commands in script files.
signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@12113 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'edk2/ShellPkg/Application')
-rw-r--r--edk2/ShellPkg/Application/Shell/Shell.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/edk2/ShellPkg/Application/Shell/Shell.c b/edk2/ShellPkg/Application/Shell/Shell.c
index 452c65588..e817a1114 100644
--- a/edk2/ShellPkg/Application/Shell/Shell.c
+++ b/edk2/ShellPkg/Application/Shell/Shell.c
@@ -1619,6 +1619,7 @@ RunScriptFileHandle (
SCRIPT_COMMAND_LIST *LastCommand;
BOOLEAN Ascii;
BOOLEAN PreScriptEchoState;
+ BOOLEAN PreCommandEchoState;
CONST CHAR16 *CurDir;
UINTN LineCount;
@@ -1806,7 +1807,22 @@ RunScriptFileHandle (
}
ShellPrintEx(-1, -1, L"%s\r\n", CommandLine2);
}
- Status = RunCommand(CommandLine3);
+ if (CommandLine3[0] == L'@') {
+ //
+ // We need to save the current echo state
+ // and disable echo for just this command.
+ //
+ PreCommandEchoState = ShellCommandGetEchoState();
+ ShellCommandSetEchoState(FALSE);
+ Status = RunCommand(CommandLine3+1);
+
+ //
+ // Now restore the pre-'@' echo state.
+ //
+ ShellCommandSetEchoState(PreCommandEchoState);
+ } else {
+ Status = RunCommand(CommandLine3);
+ }
}
if (ShellCommandGetScriptExit()) {