/** @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
}\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
{\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
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
},\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