NetworkPkg: Support print help information using -? command.
v2: *Modify the logic of show SAD,SPD and PAD help info, include them in -? instead of follow -p command. Since Shell supports finding help information from resource section of application image. We modify the Shell application Under NetworkPkg to support print help information string using -? command. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Shell application for VLAN configuration.
|
||||
|
||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2016, 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
|
||||
@@ -23,8 +23,14 @@
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiHiiServicesLib.h>
|
||||
#include <Library/NetLib.h>
|
||||
|
||||
//
|
||||
// String token ID of VConfig command help message text.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringVConfigHelpTokenId = STRING_TOKEN (STR_VCONFIG_HELP);
|
||||
|
||||
#define INVALID_NIC_INDEX 0xffff
|
||||
#define INVALID_VLAN_ID 0xffff
|
||||
|
||||
@@ -608,13 +614,39 @@ VlanConfigMain (
|
||||
{
|
||||
LIST_ENTRY *List;
|
||||
CONST CHAR16 *Str;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
|
||||
EFI_STATUS Status;
|
||||
|
||||
mImageHandle = ImageHandle;
|
||||
|
||||
//
|
||||
// Retrieve HII package list from ImageHandle
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ImageHandle,
|
||||
&gEfiHiiPackageListProtocolGuid,
|
||||
(VOID **) &PackageList,
|
||||
ImageHandle,
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Register our string package to HII database.
|
||||
// Publish HII package list to HII Database.
|
||||
//
|
||||
mHiiHandle = HiiAddPackages (&gEfiCallerIdGuid, ImageHandle, VConfigStrings, NULL);
|
||||
Status = gHiiDatabase->NewPackageList (
|
||||
gHiiDatabase,
|
||||
PackageList,
|
||||
NULL,
|
||||
&mHiiHandle
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (mHiiHandle == NULL) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -626,11 +658,6 @@ VlanConfigMain (
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (ShellCommandLineGetFlag (List, L"-?")) {
|
||||
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_VCONFIG_HELP), mHiiHandle);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (ShellCommandLineGetFlag (List, L"-l")) {
|
||||
Str = ShellCommandLineGetValue (List, L"-l");
|
||||
DisplayVlan ((CHAR16 *) Str);
|
||||
|
Reference in New Issue
Block a user