IN CONST CHAR16 *FileName\r
);\r
\r
+/**\r
+ Function to print help file / man page content in the spec from the UEFI Shell protocol GetHelpText function.\r
+\r
+ @param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed.\r
+ @param[in] SectionToGetHelpOn Pointer to the section specifier(s).\r
+ @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints \r
+ the help content only.\r
+ @retval EFI_DEVICE_ERROR The help data format was incorrect.\r
+ @retval EFI_NOT_FOUND The help data could not be found.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellPrintHelp (\r
+ IN CONST CHAR16 *CommandToGetHelpOn,\r
+ IN CONST CHAR16 *SectionToGetHelpOn,\r
+ IN BOOLEAN PrintCommandText\r
+ );\r
+\r
#endif // __SHELL_LIB__\r
return (Status);\r
}\r
\r
+/**\r
+ Function to print help file / man page content in the spec from the UEFI Shell protocol GetHelpText function.\r
+\r
+ @param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed.\r
+ @param[in] SectionToGetHelpOn Pointer to the section specifier(s).\r
+ @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints \r
+ the help content only.\r
+ @retval EFI_DEVICE_ERROR The help data format was incorrect.\r
+ @retval EFI_NOT_FOUND The help data could not be found.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellPrintHelp (\r
+ IN CONST CHAR16 *CommandToGetHelpOn,\r
+ IN CONST CHAR16 *SectionToGetHelpOn,\r
+ IN BOOLEAN PrintCommandText\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ CHAR16 *OutText;\r
+ \r
+ OutText = NULL;\r
+ \r
+ //\r
+ // Get the string to print based\r
+ //\r
+ Status = gEfiShellProtocol->GetHelpText (CommandToGetHelpOn, SectionToGetHelpOn, &OutText);\r
+ \r
+ //\r
+ // make sure we got a valid string\r
+ //\r
+ if (EFI_ERROR(Status)){\r
+ return Status;\r
+ } \r
+ if (OutText == NULL || StrLen(OutText) == 0) {\r
+ return EFI_NOT_FOUND; \r
+ }\r
+ \r
+ //\r
+ // Chop off trailing stuff we dont need\r
+ //\r
+ while (OutText[StrLen(OutText)-1] == L'\r' || OutText[StrLen(OutText)-1] == L'\n' || OutText[StrLen(OutText)-1] == L' ') {\r
+ OutText[StrLen(OutText)-1] = CHAR_NULL;\r
+ }\r
+ \r
+ //\r
+ // Print this out to the console\r
+ //\r
+ if (PrintCommandText) {\r
+ ShellPrintEx(-1, -1, L"%H%-14s%N- %s\r\n", CommandToGetHelpOn, OutText);\r
+ } else {\r
+ ShellPrintEx(-1, -1, L"%N%s\r\n", OutText);\r
+ }\r
+ \r
+ SHELL_FREE_NON_NULL(OutText);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
/**\r
Function to delete a file by name\r
\r