diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-09 16:33:58 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-09 16:33:58 +0000 |
commit | 848997b59a5316167bfe3d3cb3671ca3b0baf9af (patch) | |
tree | 46d3767ab9c1c62cdf65b85a2f473624eeedbcc8 /ShellPkg | |
parent | 37abfb7ea1ce909c0cab34c98fd92841634dab9d (diff) | |
download | edk2-platforms-848997b59a5316167bfe3d3cb3671ca3b0baf9af.tar.xz |
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/edk2@12113 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Application/Shell/Shell.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index 452c65588b..e817a11142 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/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()) {
|