mirror of https://github.com/acidanthera/audk.git
report line number for command errors in a script.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
This commit is contained in:
parent
c976f9cb7d
commit
063aa89bef
|
@ -2518,7 +2518,11 @@ SetupAndRunCommandOrFile(
|
|||
// Now print errors
|
||||
//
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
|
||||
if (ShellCommandGetCurrentScriptFile() == NULL || ShellCommandGetCurrentScriptFile()->CurrentCommand == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status), ShellCommandGetCurrentScriptFile()->CurrentCommand->Line);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#string STR_SHELL_CRLF #language en-US "\r\n"
|
||||
|
||||
#string STR_SHELL_ERROR #language en-US "%NCommand Error Status: %r\r\n"
|
||||
#string STR_SHELL_ERROR_SCRIPT #language en-US "%NScript Error Status: %r (line number %d)\r\n"
|
||||
|
||||
#string STR_SHELL_INVALID_MAPPING #language en-US "%N'%B%s%N' is not a valid mapping.\r\n"
|
||||
#string STR_SHELL_INVALID_SPLIT #language en-US "Invalid use of pipe (%B|%N).\r\n"
|
||||
|
|
Loading…
Reference in New Issue