From nobody Tue May 7 21:24:25 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496977870613914.1521985185952; Thu, 8 Jun 2017 20:11:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 20ED521A143FD; Thu, 8 Jun 2017 20:09:58 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6C73F21A143CB for ; Thu, 8 Jun 2017 20:09:57 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 08 Jun 2017 20:11:06 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.20]) by orsmga003.jf.intel.com with ESMTP; 08 Jun 2017 20:11:02 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,316,1493708400"; d="scan'208";a="978624110" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 9 Jun 2017 11:11:00 +0800 Message-Id: <20170609031100.50156-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [edk2] [PATCH] Shell/alias: Print detailed error when deleting alias X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Cc: Jaben Carsey Cc: Tapan Shah Reviewed-by: Jaben Carsey Reviewed-by: Tapan Shah --- ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 7 +++= ++-- .../UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg= /Library/UefiShellLevel3CommandsLib/Alias.c index 7277bd4b90..daf46a9f65 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c @@ -153,10 +153,13 @@ ShellCommandRunAlias ( Status =3D gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE); if (EFI_ERROR(Status)) { if (Status =3D=3D EFI_ACCESS_DENIED) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gSh= ellLevel3HiiHandle, L"alias"); =20 + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gSh= ellLevel3HiiHandle, L"alias"); ShellStatus =3D SHELL_ACCESS_DENIED; + } else if (Status =3D=3D EFI_NOT_FOUND) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUN= D), gShellLevel3HiiHandle, L"alias", Param1); + ShellStatus =3D SHELL_NOT_FOUND; } else { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gSh= ellLevel3HiiHandle, L"alias", Status); =20 + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gSh= ellLevel3HiiHandle, L"alias", Status); ShellStatus =3D SHELL_DEVICE_ERROR; } } diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Com= mandsLib.uni b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3C= ommandsLib.uni index b027c67335..db346b216a 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLi= b.uni @@ -2,7 +2,7 @@ // // (C) Copyright 2016 Hewlett Packard Enterprise Development LP
// (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
-// Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+// Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
// This program and the accompanying materials // are licensed and made available under the terms and conditions of the B= SD License // which accompanies this distribution. The full text of the license may b= e found at @@ -32,6 +32,7 @@ #string STR_GEN_PROBLEM #language en-US "%H%s%N: Unknown flag - = '%H%s%N'\r\n" #string STR_GEN_NO_VALUE #language en-US "%H%s%N: Missing argumen= t for flag - '%H%s%N'\r\n" #string STR_GEN_ERR_AD #language en-US "%H%s%N: Access denied.\= r\n" +#string STR_GEN_ERR_NOT_FOUND #language en-US "%H%s%N: '%H%s%N' does n= ot exist.\r\n" #string STR_GEN_ERR_UK #language en-US "%H%s%N: Status: %r\r\n" #string STR_GEN_PARAM_CON #language en-US "%H%s%N: Parameters conf= lict\r\n" #string STR_GEN_PARAM_CONFLICT #language en-US "%H%s%N: Flags conflict = with - '%H%s%N' and '%H%s%N'\r\n" --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel