From 0b42d7d8a34a99a02becf4dece78481d3cd2b2fc Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Tue, 12 Apr 2016 11:57:54 +0800 Subject: ShellPkg: Update ping command options to sync with Spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is used to update ping command options to sync with shell2.2 Spec. Considering the backward compatible issue, the patch keeps ā€˜-_sā€™ command option unchanged, only add the new option '-s' and make the old option '-_s' function same as new one. Cc: Ye Ting Cc: Fu Siyuan Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c') diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index dbee764b64..13bcdde6b5 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -2,7 +2,7 @@ The implementation for Ping shell command. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -197,6 +197,10 @@ STATIC CONST SHELL_PARAM_ITEM PingParamList[] = { L"-n", TypeValue }, + { + L"-s", + TypeValue + }, { L"-_s", TypeValue @@ -1512,7 +1516,11 @@ ShellCommandRunPing ( // // Parse the paramter of source ip address. // - ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s"); + ValueStr = ShellCommandLineGetValue (ParamPackage, L"-s"); + if (ValueStr == NULL) { + ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s"); + } + if (ValueStr != NULL) { mSrcString = ValueStr; if (IpChoice == PING_IP_CHOICE_IP6) { -- cgit v1.2.3