]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Shell/alias: Print detailed error when deleting alias
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 9 Jun 2017 03:10:32 +0000 (11:10 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Sat, 10 Jun 2017 02:23:18 +0000 (10:23 +0800)
STR_GEN_ERR_NOT_FOUND is added and currently is only
used by alias command. This string template can be used
by other commands as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni

index 7277bd4b90dcbc2d87cb2cd4ed70489d70cb8a2f..daf46a9f657a4ae034bb3e527654500d518af581 100644 (file)
@@ -153,10 +153,13 @@ ShellCommandRunAlias (
       Status = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);\r
       if (EFI_ERROR(Status)) {\r
         if (Status == EFI_ACCESS_DENIED) {\r
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");  \r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");\r
           ShellStatus = SHELL_ACCESS_DENIED;\r
+        } else if (Status == EFI_NOT_FOUND) {\r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias", Param1);\r
+          ShellStatus = SHELL_NOT_FOUND;\r
         } else {\r
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);  \r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);\r
           ShellStatus = SHELL_DEVICE_ERROR;\r
         }\r
       }\r
index b027c67335be3664b1fc4da59842c85c8618c65b..db346b216abe6f82acc06b54df6f2d1d86fca488 100644 (file)
@@ -2,7 +2,7 @@
 //\r
 // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>\r
-// Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>\r
+// Copyright (c) 2009 - 2017, 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
@@ -32,6 +32,7 @@
 #string STR_GEN_PROBLEM           #language en-US "%H%s%N: Unknown flag - '%H%s%N'\r\n"\r
 #string STR_GEN_NO_VALUE          #language en-US "%H%s%N: Missing argument for flag - '%H%s%N'\r\n"\r
 #string STR_GEN_ERR_AD            #language en-US "%H%s%N: Access denied.\r\n"\r
+#string STR_GEN_ERR_NOT_FOUND     #language en-US "%H%s%N: '%H%s%N' does not exist.\r\n"\r
 #string STR_GEN_ERR_UK            #language en-US "%H%s%N: Status: %r\r\n"\r
 #string STR_GEN_PARAM_CON         #language en-US "%H%s%N: Parameters conflict\r\n"\r
 #string STR_GEN_PARAM_CONFLICT    #language en-US "%H%s%N: Flags conflict with - '%H%s%N' and '%H%s%N'\r\n"\r