]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Ebl/Command.c
Get BlockIo mapping interfaces working. Still need to work on detecting block size...
[mirror_edk2.git] / EmbeddedPkg / Ebl / Command.c
index 3efe6ee671e6e6e1376055d374eb9c59b165024e..73122e68a36f7633d56ad107ead500f1eaefa4fd 100644 (file)
@@ -1,10 +1,10 @@
 /** @file\r
   Basic commands and command processing infrastructure for EBL\r
 \r
-  Copyright (c) 2007, Intel Corporation<BR>\r
-  Portions copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
+  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 \r
-  All rights reserved. This program and the accompanying materials\r
+  This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   http://opensource.org/licenses/bsd-license.php\r
@@ -220,6 +220,26 @@ EblGetCommand (
 }\r
 \r
 \r
+UINTN\r
+CountNewLines (\r
+  IN CHAR8  *Str\r
+  )\r
+{\r
+  UINTN Count;\r
+  \r
+  if (Str == NULL) {\r
+    return 0;\r
+  }\r
+  \r
+  for (Count = 0; *Str != '\0'; Str++) {\r
+    if (Str[Count] == '\n') {\r
+      Count++;\r
+    }\r
+  }\r
+  \r
+  return Count;\r
+}\r
+\r
 \r
 /**\r
   List out help information on all the commands or print extended information \r
@@ -243,16 +263,22 @@ EblHelpCmd (
 {\r
   UINTN   Index;\r
   CHAR8   *Ptr;\r
-  UINTN   CurrentRow;\r
+  UINTN   CurrentRow = 0;\r
 \r
   if (Argc == 1) {\r
     // Print all the commands\r
     AsciiPrint ("Embedded Boot Loader (EBL) commands (help command for more info):\n");\r
+    CurrentRow++;\r
     for (Index = 0; Index < mCmdTableNextFreeIndex; Index++) {\r
       EblSetTextColor (EFI_YELLOW);\r
       AsciiPrint (" %a", mCmdTable[Index]->Name);\r
       EblSetTextColor (0);\r
       AsciiPrint ("%a\n", mCmdTable[Index]->HelpSummary);\r
+      // Handle multi line help summaries\r
+      CurrentRow += CountNewLines (mCmdTable[Index]->HelpSummary);\r
+      if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
+        break;\r
+      }\r
     }\r
   } else if (Argv[1] != NULL) {\r
     // Print specific help \r
@@ -260,6 +286,8 @@ EblHelpCmd (
       if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) {\r
         Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help;\r
         AsciiPrint ("%a%a\n", Argv[1], Ptr);\r
+        // Handle multi line help summaries\r
+        CurrentRow += CountNewLines (Ptr);\r
         if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
           break;\r
         }\r
@@ -847,7 +875,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdTemplate[] =
   },\r
   {\r
     "hexdump",\r
-    "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex bytes at a given width",\r
+    "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex .width",\r
     NULL,\r
     EblHexdumpCmd\r
   }\r