On 04/04/2016 11:58 AM, Carsey, Jaben wrote:


-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo
Ersek
Sent: Monday, April 04, 2016 10:47 AM
To: Bhupesh Sharma <bhupesh.sha...@nxp.com>
Cc: edk2-devel@lists.01.org <edk2-de...@ml01.01.org>; David Van Arnem
<dvanar...@cmlab.biz>
Subject: Re: [edk2] Using multiple SNP drivers on Shell
Importance: High

On 04/04/16 19:38, Bhupesh Sharma wrote:
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: Monday, April 04, 2016 11:06 PM

On 04/04/16 19:24, David Van Arnem wrote:
On 04/04/2016 03:17 AM, Laszlo Ersek wrote:

The most recent version (that I have) of the Shell Spec is 2.2. That
version lists both "ping" and "ping6", and the synopsis for "ping" is:

    Ping [-n count] [-l size] [-s SourceIp] TargetIp

Interesting, it looks like we each have a different "ping" command:
Bhupesh's requires "-_s [SourceIP]", Laszlo's uses "-s [SourceIP]",
and mine (not sure which commit it was build from, I built it a while
ago) says to use "-s [interface name]" (this may work with the Source
IP also, but the "help" gave eth0 as an example).

Note: I didn't test "my" ping command, only proved it right ^W^W^W
quoted
the shell spec. :)

But, I suppose that is a moot point, since I should be using an
up-to-date Shell as Laszlo recommended.

The shell source code still uses L"-_s" for the ping (v4) command; only
the ping6 command uses L"-s". Compare:

- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
- ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c

And L"-_s" in the former dates back to this commit:

commit 68fb05272b45b473fe030ac11dcb79d3f3c0aecd
Author: jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Date:   Fri Mar 25 20:47:02 2011 +0000

     Add Network1 profile.

     git-svn-id:
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11423
6f19259b-4bc3-4df7-8a09-765794883524

The following command:

   git grep 'L"-_' -- ShellPkg

returns a few more hits. I'm thinking the "-_option" pattern is for non-
standard options, and the underscore is supposed to prevent conflicts
with any future standardization.

Maybe in the case of the Ping command, L"-_s" could now be simply
replaced with L"-s".

IMHO, -_s makes no sense. -s is definitely concise and more readable.

Well, the question is whether the behavior of the historical "-_s"
option matches that of the recently standardized "-s" option.

If so, then it's a simple rename.

If the behaviors are different, then "-s" should be implemented
separately, and "-_s" might be preferable to preserve also, as a
non-standard extension.

All non-standard parameters are started with _ per shell specification.

If the behaviors are different it's certainly worth discussing making sure that 
needs are met.  The whole goal of making it an official parameter was to make 
backwards compatibility guaranteed.


My apologies (sigh), but I must have gotten a prebuilt Shell with the "-s [interface]" ping option from somewhere besides building it from the EDK2 sources. I tried building ShellPkg again from the commit I thought I originally built from, but the output image is ~600KB larger than the one I was using, and it won't load on my target system (which has an implementation based off the UEFI 2.1 spec). I really can't remember where the Shell I've been using came from, but I suspect it's very old...

Anyway, my point being, the ping command in "my" Shell probably shouldn't be used as a comparison here.

David




Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel



--
Thanks,
David Van Arnem
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to