mirror of https://github.com/acidanthera/audk.git
ShellPkg: Update Level3 profile commands response output
Updates to Level3 profile commands response output. Updating Level3 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16732 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ab7c10f28e
commit
e54a10bbca
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Alias shell level 3 function.
|
Main file for Alias shell level 3 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -111,7 +112,7 @@ ShellCommandRunAlias (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"alias", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -156,18 +157,18 @@ ShellCommandRunAlias (
|
||||||
Status = gEfiShellProtocol->SetAlias(CleanParam2, Param1, FALSE, ShellCommandLineGetFlag(Package, L"-v"));
|
Status = gEfiShellProtocol->SetAlias(CleanParam2, Param1, FALSE, ShellCommandLineGetFlag(Package, L"-v"));
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_ACCESS_DENIED) {
|
if (Status == EFI_ACCESS_DENIED) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
|
||||||
ShellStatus = SHELL_ACCESS_DENIED;
|
ShellStatus = SHELL_ACCESS_DENIED;
|
||||||
} else {
|
} else {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
|
||||||
ShellStatus = SHELL_DEVICE_ERROR;
|
ShellStatus = SHELL_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ShellCommandLineGetCount(Package) == 2) {
|
} else if (ShellCommandLineGetCount(Package) == 2) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"alias");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"alias");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for attrib shell level 2 function.
|
Main file for attrib shell level 2 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -54,7 +55,7 @@ ShellCommandRunCls (
|
||||||
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"cls", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -77,11 +78,11 @@ ShellCommandRunCls (
|
||||||
//
|
//
|
||||||
gST->ConOut->ClearScreen (gST->ConOut);
|
gST->ConOut->ClearScreen (gST->ConOut);
|
||||||
} else if (ShellCommandLineGetCount(Package) > 2) {
|
} else if (ShellCommandLineGetCount(Package) > 2) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"cls");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {
|
if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"cls", Param1);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
switch (ShellStrToUintn(Param1)) {
|
switch (ShellStrToUintn(Param1)) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Echo shell level 3 function.
|
Main file for Echo shell level 3 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -60,7 +61,7 @@ ShellCommandRunEcho (
|
||||||
Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE);
|
Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"echo", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for GetMtc shell level 3 function.
|
Main file for GetMtc shell level 3 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -50,7 +51,7 @@ ShellCommandRunGetMtc (
|
||||||
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"getmtc", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,7 +64,7 @@ ShellCommandRunGetMtc (
|
||||||
if (ShellCommandLineGetFlag(Package, L"-?")) {
|
if (ShellCommandLineGetFlag(Package, L"-?")) {
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
} else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
|
} else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"getmtc");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||||
Copyright (c) 2014, ARM Limited. All rights reserved. <BR>
|
Copyright (c) 2014, ARM Limited. All rights reserved. <BR>
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -154,7 +156,7 @@ ShellCommandRunHelp (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"help", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -168,10 +170,10 @@ ShellCommandRunHelp (
|
||||||
&&ShellCommandLineGetFlag(Package, L"-section")
|
&&ShellCommandLineGetFlag(Package, L"-section")
|
||||||
&&(ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v"))
|
&&(ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v"))
|
||||||
){
|
){
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle, L"help");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
|
} else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"help");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Pause shell level 3 function.
|
Main file for Pause shell level 3 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -52,7 +53,7 @@ ShellCommandRunPause (
|
||||||
ASSERT_EFI_ERROR(Status);
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
if (!gEfiShellProtocol->BatchIsActive()) {
|
if (!gEfiShellProtocol->BatchIsActive()) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_SCRIPT_ONLY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel3HiiHandle, L"pause");
|
||||||
return (SHELL_UNSUPPORTED);
|
return (SHELL_UNSUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ ShellCommandRunPause (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"pause", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -75,7 +76,7 @@ ShellCommandRunPause (
|
||||||
if (ShellCommandLineGetFlag(Package, L"-?")) {
|
if (ShellCommandLineGetFlag(Package, L"-?")) {
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
} else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
|
} else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"pause");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
if (!ShellCommandLineGetFlag(Package, L"-q")) {
|
if (!ShellCommandLineGetFlag(Package, L"-q")) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Touch shell level 3 function.
|
Main file for Touch shell level 3 function.
|
||||||
|
|
||||||
|
Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -99,7 +100,7 @@ DoTouchByHandle (
|
||||||
//
|
//
|
||||||
Status = TouchFileByHandle(Handle);
|
Status = TouchFileByHandle(Handle);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Name, Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Name);
|
||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +130,7 @@ DoTouchByHandle (
|
||||||
//
|
//
|
||||||
Status = gEfiShellProtocol->OpenFileByName (Walker->FullName, &Walker->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
|
Status = gEfiShellProtocol->OpenFileByName (Walker->FullName, &Walker->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Walker->FullName, Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Walker->FullName);
|
||||||
Status = EFI_ACCESS_DENIED;
|
Status = EFI_ACCESS_DENIED;
|
||||||
} else {
|
} else {
|
||||||
Status = DoTouchByHandle(Walker->FullName, FS, Walker->Handle, TRUE);
|
Status = DoTouchByHandle(Walker->FullName, FS, Walker->Handle, TRUE);
|
||||||
|
@ -197,7 +198,7 @@ ShellCommandRunTouch (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"touch", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -214,7 +215,7 @@ ShellCommandRunTouch (
|
||||||
//
|
//
|
||||||
// we insufficient parameters
|
// we insufficient parameters
|
||||||
//
|
//
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"touch");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -227,7 +228,7 @@ ShellCommandRunTouch (
|
||||||
){
|
){
|
||||||
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, &FileList);
|
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, &FileList);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, (CHAR16*)Param);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"touch", (CHAR16*)Param);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +241,7 @@ ShellCommandRunTouch (
|
||||||
// check that we have at least 1 file
|
// check that we have at least 1 file
|
||||||
//
|
//
|
||||||
if (FileList == NULL || IsListEmpty(&FileList->Link)) {
|
if (FileList == NULL || IsListEmpty(&FileList->Link)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"touch", Param);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -254,14 +255,14 @@ ShellCommandRunTouch (
|
||||||
// make sure the file opened ok
|
// make sure the file opened ok
|
||||||
//
|
//
|
||||||
if (EFI_ERROR(Node->Status)){
|
if (EFI_ERROR(Node->Status)){
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = DoTouchByHandle(Node->FullName, NULL, Node->Handle, ShellCommandLineGetFlag(Package, L"-r"));
|
Status = DoTouchByHandle(Node->FullName, NULL, Node->Handle, ShellCommandLineGetFlag(Package, L"-r"));
|
||||||
if (EFI_ERROR(Status) && Status != EFI_ACCESS_DENIED) {
|
if (EFI_ERROR(Status) && Status != EFI_ACCESS_DENIED) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"touch", Node->FileName);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Type shell level 3 function.
|
Main file for Type shell level 3 function.
|
||||||
|
|
||||||
Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
|
Copyright (c) 2013 - 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -208,7 +208,7 @@ ShellCommandRunType (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"type", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -225,13 +225,13 @@ ShellCommandRunType (
|
||||||
UnicodeMode = ShellCommandLineGetFlag(Package, L"-u");
|
UnicodeMode = ShellCommandLineGetFlag(Package, L"-u");
|
||||||
|
|
||||||
if (AsciiMode && UnicodeMode) {
|
if (AsciiMode && UnicodeMode) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"-a & -u");
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"type", L"-a & -u");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
|
} else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
|
||||||
//
|
//
|
||||||
// we insufficient parameters
|
// we insufficient parameters
|
||||||
//
|
//
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle, L"type");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -244,7 +244,7 @@ ShellCommandRunType (
|
||||||
){
|
){
|
||||||
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);
|
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, (CHAR16*)Param);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", (CHAR16*)Param);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ ShellCommandRunType (
|
||||||
// check that we have at least 1 file
|
// check that we have at least 1 file
|
||||||
//
|
//
|
||||||
if (FileList == NULL || IsListEmpty(&FileList->Link)) {
|
if (FileList == NULL || IsListEmpty(&FileList->Link)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, L"type", Param);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -276,7 +276,7 @@ ShellCommandRunType (
|
||||||
// make sure the file opened ok
|
// make sure the file opened ok
|
||||||
//
|
//
|
||||||
if (EFI_ERROR(Node->Status)){
|
if (EFI_ERROR(Node->Status)){
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, L"type", Node->FileName);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ ShellCommandRunType (
|
||||||
// make sure its not a directory
|
// make sure its not a directory
|
||||||
//
|
//
|
||||||
if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
|
if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, Node->FileName);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, L"type", Node->FileName);
|
||||||
ShellStatus = SHELL_NOT_FOUND;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ ShellCommandRunType (
|
||||||
//
|
//
|
||||||
Status = TypeFileByHandle (Node->Handle, AsciiMode, UnicodeMode);
|
Status = TypeFileByHandle (Node->Handle, AsciiMode, UnicodeMode);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TYP_ERROR), gShellLevel3HiiHandle, Node->FileName, Status);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TYP_ERROR), gShellLevel3HiiHandle, L"type", Node->FileName);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
ASSERT(ShellStatus == SHELL_SUCCESS);
|
ASSERT(ShellStatus == SHELL_SUCCESS);
|
||||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Main file for Ver shell level 3 function.
|
Main file for Ver shell level 3 function.
|
||||||
|
|
||||||
Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
|
Copyright (c) 2013 - 2015, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -63,7 +63,7 @@ ShellCommandRunVer (
|
||||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"ver", ProblemParam);
|
||||||
FreePool(ProblemParam);
|
FreePool(ProblemParam);
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ ShellCommandRunVer (
|
||||||
//
|
//
|
||||||
// we have too many parameters
|
// we have too many parameters
|
||||||
//
|
//
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"ver");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
if (ShellCommandLineGetFlag(Package, L"-s")) {
|
if (ShellCommandLineGetFlag(Package, L"-s")) {
|
||||||
|
|
Loading…
Reference in New Issue