]> git.proxmox.com Git - mirror_edk2.git/commitdiff
This adds support for @ prefixed commands in script files.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Aug 2011 16:33:58 +0000 (16:33 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Aug 2011 16:33:58 +0000 (16:33 +0000)
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

ShellPkg/Application/Shell/Shell.c

index 452c65588be502a140615260cd71e94d334521bd..e817a1114267b7ec7e84f9e8ecc33f0aae8f090e 100644 (file)
@@ -1619,6 +1619,7 @@ RunScriptFileHandle (
   SCRIPT_COMMAND_LIST *LastCommand;\r
   BOOLEAN             Ascii;\r
   BOOLEAN             PreScriptEchoState;\r
+  BOOLEAN             PreCommandEchoState;\r
   CONST CHAR16        *CurDir;\r
   UINTN               LineCount;\r
 \r
@@ -1806,7 +1807,22 @@ RunScriptFileHandle (
             }\r
             ShellPrintEx(-1, -1, L"%s\r\n", CommandLine2);\r
           }\r
-          Status = RunCommand(CommandLine3);\r
+          if (CommandLine3[0] == L'@') {\r
+            //\r
+            // We need to save the current echo state\r
+            // and disable echo for just this command.\r
+            //\r
+            PreCommandEchoState = ShellCommandGetEchoState();\r
+            ShellCommandSetEchoState(FALSE);\r
+            Status = RunCommand(CommandLine3+1);\r
+\r
+            //\r
+            // Now restore the pre-'@' echo state.\r
+            //\r
+            ShellCommandSetEchoState(PreCommandEchoState);\r
+          } else {\r
+            Status = RunCommand(CommandLine3);\r
+          }\r
         }\r
 \r
         if (ShellCommandGetScriptExit()) {\r