Follow Shell specification to make sure the “command.man” file is always used no matter “command.efi -?” or “command -?” is typed.
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14947 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -2769,15 +2769,33 @@ EfiShellGetHelpText(
|
||||
)
|
||||
{
|
||||
CONST CHAR16 *ManFileName;
|
||||
CHAR16 *FixCommand;
|
||||
EFI_STATUS Status;
|
||||
|
||||
ASSERT(HelpText != NULL);
|
||||
FixCommand = NULL;
|
||||
|
||||
ManFileName = ShellCommandGetManFileNameHandler(Command);
|
||||
|
||||
if (ManFileName != NULL) {
|
||||
return (ProcessManFile(ManFileName, Command, Sections, NULL, HelpText));
|
||||
} else {
|
||||
return (ProcessManFile(Command, Command, Sections, NULL, HelpText));
|
||||
if ((StrLen(Command)> 4)
|
||||
&& (Command[StrLen(Command)-1] == L'i' || Command[StrLen(Command)-1] == L'I')
|
||||
&& (Command[StrLen(Command)-2] == L'f' || Command[StrLen(Command)-2] == L'F')
|
||||
&& (Command[StrLen(Command)-3] == L'e' || Command[StrLen(Command)-3] == L'E')
|
||||
&& (Command[StrLen(Command)-4] == L'.')
|
||||
) {
|
||||
FixCommand = AllocateZeroPool(StrSize(Command) - 4 * sizeof (CHAR16));
|
||||
ASSERT(FixCommand != NULL);
|
||||
|
||||
StrnCpy(FixCommand, Command, StrLen(Command)-4);
|
||||
Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText);
|
||||
FreePool(FixCommand);
|
||||
return Status;
|
||||
} else {
|
||||
return (ProcessManFile(Command, Command, Sections, NULL, HelpText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user