summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Ebl/Command.c
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-12 20:13:55 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-12 20:13:55 +0000
commit60428d0000da41bb55b41984f785761fcd6320be (patch)
tree1f3b9929e31aa5aa9f11516756d848f187557568 /EmbeddedPkg/Ebl/Command.c
parent135ec2db42941107fc2ec69107784828a1f81e91 (diff)
downloadedk2-60428d0000da41bb55b41984f785761fcd6320be.zip
edk2-60428d0000da41bb55b41984f785761fcd6320be.tar.gz
edk2-60428d0000da41bb55b41984f785761fcd6320be.tar.bz2
Fix help command scroll issue. Also add FV space used, and free space to dir command.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9996 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/Ebl/Command.c')
-rw-r--r--EmbeddedPkg/Ebl/Command.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/EmbeddedPkg/Ebl/Command.c b/EmbeddedPkg/Ebl/Command.c
index 3efe6ee..9527cfe 100644
--- a/EmbeddedPkg/Ebl/Command.c
+++ b/EmbeddedPkg/Ebl/Command.c
@@ -220,6 +220,26 @@ EblGetCommand (
}
+UINTN
+CountNewLines (
+ IN CHAR8 *Str
+ )
+{
+ UINTN Count;
+
+ if (Str == NULL) {
+ return 0;
+ }
+
+ for (Count = 0; *Str != '\0'; Str++) {
+ if (Str[Count] == '\n') {
+ Count++;
+ }
+ }
+
+ return Count;
+}
+
/**
List out help information on all the commands or print extended information
@@ -243,16 +263,22 @@ EblHelpCmd (
{
UINTN Index;
CHAR8 *Ptr;
- UINTN CurrentRow;
+ UINTN CurrentRow = 0;
if (Argc == 1) {
// Print all the commands
AsciiPrint ("Embedded Boot Loader (EBL) commands (help command for more info):\n");
+ CurrentRow++;
for (Index = 0; Index < mCmdTableNextFreeIndex; Index++) {
EblSetTextColor (EFI_YELLOW);
AsciiPrint (" %a", mCmdTable[Index]->Name);
EblSetTextColor (0);
AsciiPrint ("%a\n", mCmdTable[Index]->HelpSummary);
+ // Handle multi line help summaries
+ CurrentRow += CountNewLines (mCmdTable[Index]->HelpSummary);
+ if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
+ break;
+ }
}
} else if (Argv[1] != NULL) {
// Print specific help
@@ -260,6 +286,8 @@ EblHelpCmd (
if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) {
Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help;
AsciiPrint ("%a%a\n", Argv[1], Ptr);
+ // Handle multi line help summaries
+ CurrentRow += CountNewLines (Ptr);
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
break;
}
@@ -847,7 +875,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdTemplate[] =
},
{
"hexdump",
- "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex bytes at a given width",
+ "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex .width",
NULL,
EblHexdumpCmd
}