]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
Update inf file to follow spec.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel3CommandsLib / Help.c
index 04e3d31dba7ae9e93a6cc4a413a167455327d05c..1c643b0e578f6536e2118efb06c2e3a56a209365 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Main file for Help shell level 3 function.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\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
@@ -18,7 +18,7 @@
 \r
 STATIC CONST SHELL_PARAM_ITEM ParamList[] = {\r
   {L"-usage", TypeFlag},\r
-  {L"-section", TypeValue},\r
+  {L"-section", TypeMaxValue},\r
   {L"-verbose", TypeFlag},\r
   {L"-v", TypeFlag},\r
   {NULL, TypeMax}\r
@@ -133,19 +133,24 @@ ShellCommandRunHelp (
         FreePool(HiiString);\r
         Found = TRUE;\r
       } else {\r
-        CommandList = ShellCommandGetCommandList();\r
+        CommandList = ShellCommandGetCommandList(TRUE);\r
         ASSERT(CommandList != NULL);\r
         for ( Node = (COMMAND_LIST*)GetFirstNode(&CommandList->Link)\r
             ; CommandList != NULL && !IsListEmpty(&CommandList->Link) && !IsNull(&CommandList->Link, &Node->Link)\r
             ; Node = (COMMAND_LIST*)GetNextNode(&CommandList->Link, &Node->Link)\r
            ){\r
-          if (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) {\r
+          if ((gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) ||\r
+             (gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL) != NULL && (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, (CHAR16*)(gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL)))))) {\r
             //\r
             // We have a command to look for help on.\r
             //\r
             Status = gEfiShellProtocol->GetHelpText(Node->CommandString, SectionToGetHelpOn, &OutText);\r
             if (EFI_ERROR(Status) || OutText == NULL) {\r
-              ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);\r
+              if (Status == EFI_DEVICE_ERROR) {\r
+                ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_INV), gShellLevel3HiiHandle, Node->CommandString);\r
+              } else {\r
+                ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);\r
+              }\r
               ShellStatus = SHELL_NOT_FOUND;\r
             } else {\r
               while (OutText[StrLen(OutText)-1] == L'\r' || OutText[StrLen(OutText)-1] == L'\n' || OutText[StrLen(OutText)-1] == L' ') {\r