summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLevel3CommandsLib
diff options
context:
space:
mode:
authorTapan Shah <tapandshah@hpe.com>2016-10-24 09:56:37 -0700
committerJaben Carsey <jaben.carsey@intel.com>2016-10-24 10:27:08 -0700
commit9d54bf4e7ef13fc0d8ccb954d106fc6ff29dd8ea (patch)
treea067db3a514ad639bd256bb98e6857ffbe77c490 /ShellPkg/Library/UefiShellLevel3CommandsLib
parent60d9f5f43bbb7e0a859c1f744a20cee88af9c863 (diff)
downloadedk2-9d54bf4e7ef13fc0d8ccb954d106fc6ff29dd8ea.tar.gz
edk2-9d54bf4e7ef13fc0d8ccb954d106fc6ff29dd8ea.tar.bz2
edk2-9d54bf4e7ef13fc0d8ccb954d106fc6ff29dd8ea.zip
ShellPkg: handle '-t or -terse' and '-s' flags for 'ver' command properly
'-t or -terse' and '-s' flags are multiple exclusive So when both flags are used together, command should report an error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel3CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c
index deefaf0bb2..d0e2b5cb24 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c
@@ -1,6 +1,7 @@
/** @file
Main file for Ver shell level 3 function.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
@@ -84,15 +85,20 @@ ShellCommandRunVer (
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
if (ShellCommandLineGetFlag(Package, L"-s")) {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SIMPLE),
- gShellLevel3HiiHandle,
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion
- );
+ if (ShellCommandLineGetFlag(Package, L"-terse") || ShellCommandLineGetFlag(Package, L"-t")){
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellLevel3HiiHandle, L"ver", L"-t or -terse", L"-s");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ ShellPrintHiiEx (
+ 0,
+ gST->ConOut->Mode->CursorRow,
+ NULL,
+ STRING_TOKEN (STR_VER_OUTPUT_SIMPLE),
+ gShellLevel3HiiHandle,
+ gEfiShellProtocol->MajorVersion,
+ gEfiShellProtocol->MinorVersion
+ );
+ }
} else {
ShellPrintHiiEx (
0,