From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0028E1A1E3B for ; Mon, 24 Oct 2016 10:28:18 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 24 Oct 2016 10:28:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="1058398031" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 24 Oct 2016 10:28:10 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 24 Oct 2016 10:28:07 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.170]) by FMSMSX153.amr.corp.intel.com ([169.254.9.16]) with mapi id 14.03.0248.002; Mon, 24 Oct 2016 10:28:07 -0700 From: "Carsey, Jaben" To: Tapan Shah , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [PATCH] ShellPkg: handle '-t or -terse' and '-s' flags for 'ver' command properly Thread-Index: AQHSLheaaDpvfLJNxE+D1p7MpH0F1KC3277Q Date: Mon, 24 Oct 2016 17:28:06 +0000 Message-ID: References: <1477328197-1608-1-git-send-email-tapandshah@hpe.com> In-Reply-To: <1477328197-1608-1-git-send-email-tapandshah@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzdhZGYwNWQtOWE4My00NWE1LTgyMmUtZGYwM2ZmYmQ4MWUzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjJjZ3hUellpOFFNcnZGZzJHOG5HMzRaZHVTQzUyeWJqTGRTNGk1TWJSZjA9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg: handle '-t or -terse' and '-s' flags for 'ver' command properly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 17:28:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey And pushed. > -----Original Message----- > From: Tapan Shah [mailto:tapandshah@hpe.com] > Sent: Monday, October 24, 2016 9:57 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Tapan Shah > > Subject: [PATCH] ShellPkg: handle '-t or -terse' and '-s' flags for 'ver' > command properly > Importance: High >=20 > '-t or -terse' and '-s' flags are multiple exclusive > So when both flags are used together, command should report an error > message. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Tapan Shah > --- > ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c | 24 > ++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) >=20 > diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c > b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c > index deefaf0..d0e2b5c 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. >=20 > + (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
> This program and the accompanying materials > @@ -84,15 +85,20 @@ ShellCommandRunVer ( > ShellStatus =3D 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 =3D 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, > -- > 1.9.5.msysgit.0