public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Shell/alias: Print detailed error when deleting alias
@ 2017-06-09  3:11 Ruiyu Ni
  2017-06-09 14:14 ` Carsey, Jaben
  2017-06-09 16:25 ` Shah, Tapan
  0 siblings, 2 replies; 3+ messages in thread
From: Ruiyu Ni @ 2017-06-09  3:11 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jaben Carsey, Tapan Shah

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>
Cc: Tapan Shah <tapandshah@hpe.com>
---
 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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
       if (EFI_ERROR(Status)) {
         if (Status == EFI_ACCESS_DENIED) {
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");  
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
           ShellStatus = SHELL_ACCESS_DENIED;
+        } else if (Status == EFI_NOT_FOUND) {
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias", Param1);
+          ShellStatus = SHELL_NOT_FOUND;
         } else {
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);  
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
           ShellStatus = SHELL_DEVICE_ERROR;
         }
       }
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
index b027c67335..db346b216a 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
@@ -2,7 +2,7 @@
 //
 // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
-// Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
+// Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved. <BR>
 // This program and the accompanying materials
 // 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
@@ -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 argument 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 not 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 conflict\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"
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Shell/alias: Print detailed error when deleting alias
  2017-06-09  3:11 [PATCH] Shell/alias: Print detailed error when deleting alias Ruiyu Ni
@ 2017-06-09 14:14 ` Carsey, Jaben
  2017-06-09 16:25 ` Shah, Tapan
  1 sibling, 0 replies; 3+ messages in thread
From: Carsey, Jaben @ 2017-06-09 14:14 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Thursday, June 08, 2017 8:11 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [edk2] [PATCH] Shell/alias: Print detailed error when deleting alias
> Importance: High
> 
> 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>
> Cc: Tapan Shah <tapandshah@hpe.com>
> ---
>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
>        if (EFI_ERROR(Status)) {
>          if (Status == EFI_ACCESS_DENIED) {
> -          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellLevel3HiiHandle, L"alias");
> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellLevel3HiiHandle, L"alias");
>            ShellStatus = SHELL_ACCESS_DENIED;
> +        } else if (Status == EFI_NOT_FOUND) {
> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias", Param1);
> +          ShellStatus = SHELL_NOT_FOUND;
>          } else {
> -          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> gShellLevel3HiiHandle, L"alias", Status);
> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> gShellLevel3HiiHandle, L"alias", Status);
>            ShellStatus = SHELL_DEVICE_ERROR;
>          }
>        }
> diff --git
> a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Commands
> Lib.uni
> b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Commands
> Lib.uni
> index b027c67335..db346b216a 100644
> ---
> a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Commands
> Lib.uni
> +++
> b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Commands
> Lib.uni
> @@ -2,7 +2,7 @@
>  //
>  // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>  // (C) Copyright 2013-2015 Hewlett-Packard Development Company,
> L.P.<BR>
> -// Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
> +// Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved. <BR>
>  // This program and the accompanying materials
>  // 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
> @@ -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
> argument 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 not 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 conflict\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"
> --
> 2.12.2.windows.2
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Shell/alias: Print detailed error when deleting alias
  2017-06-09  3:11 [PATCH] Shell/alias: Print detailed error when deleting alias Ruiyu Ni
  2017-06-09 14:14 ` Carsey, Jaben
@ 2017-06-09 16:25 ` Shah, Tapan
  1 sibling, 0 replies; 3+ messages in thread
From: Shah, Tapan @ 2017-06-09 16:25 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel@lists.01.org; +Cc: Jaben Carsey

Thanks for fixing this Ray.

Reviewed-by: Tapan Shah <tapandshah@hpe.com>

-----Original Message-----
From: Ruiyu Ni [mailto:ruiyu.ni@intel.com] 
Sent: Thursday, June 08, 2017 10:11 PM
To: edk2-devel@lists.01.org
Cc: Jaben Carsey <jaben.carsey@intel.com>; Shah, Tapan <tapandshah@hpe.com>
Subject: [PATCH] Shell/alias: Print detailed error when deleting alias

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>
Cc: Tapan Shah <tapandshah@hpe.com>
---
 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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
       if (EFI_ERROR(Status)) {
         if (Status == EFI_ACCESS_DENIED) {
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");  
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), 
+ gShellLevel3HiiHandle, L"alias");
           ShellStatus = SHELL_ACCESS_DENIED;
+        } else if (Status == EFI_NOT_FOUND) {
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias", Param1);
+          ShellStatus = SHELL_NOT_FOUND;
         } else {
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);  
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), 
+ gShellLevel3HiiHandle, L"alias", Status);
           ShellStatus = SHELL_DEVICE_ERROR;
         }
       }
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
index b027c67335..db346b216a 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Command
+++ sLib.uni
@@ -2,7 +2,7 @@
 //
 // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>  // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> -// Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
+// Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved. 
+<BR>
 // This program and the accompanying materials  // 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 @@ -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 argument 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 not 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 conflict\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"
--
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-09 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09  3:11 [PATCH] Shell/alias: Print detailed error when deleting alias Ruiyu Ni
2017-06-09 14:14 ` Carsey, Jaben
2017-06-09 16:25 ` Shah, Tapan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox