diff options
author | Chris Phillips <chrisp@hp.com> | 2014-08-22 17:00:49 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-22 17:00:49 +0000 |
commit | c173a7b9d6f239e3a002f4e9c37db98a8f98f771 (patch) | |
tree | 051a5fcb0afa693f69a8b488ab3252b19c3305ec /ShellPkg/Library/UefiShellDriver1CommandsLib | |
parent | 83185c5a0e3e79fa22bf33c61d4e228cedd22ef5 (diff) | |
download | edk2-platforms-c173a7b9d6f239e3a002f4e9c37db98a8f98f771.tar.xz |
ShellPkg: Fixes and updates for the 'devices' command
- Update 'devices -sfo' format to match UEFI Shell 2.1 spec
- Update help output for easier viewing
- Update 'devices' output format for better alignment when there are many device handles:
T D
Y C I
P F A
CTRL E G G #P #D #C Device Name
==== = = = == == === =========================================================
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Phillips <chrisp@hp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15884 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib')
-rw-r--r-- | ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c | 58 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni | bin | 67508 -> 67740 bytes |
2 files changed, 24 insertions, 34 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c index afabc8a698..f962bf40c0 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c @@ -1,6 +1,7 @@ /** @file
Main file for devices shell Driver1 function.
+ (C) Copyright 2012-2014, Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2014, 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
@@ -114,6 +115,7 @@ GetDeviceHandleInfo ( }
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ {L"-sfo", TypeFlag},
{L"-l", TypeValue},
{NULL, TypeMax}
};
@@ -146,9 +148,11 @@ ShellCommandRunDevices ( UINTN Children;
CHAR16 *Name;
CONST CHAR16 *Lang;
+ BOOLEAN SfoFlag;
ShellStatus = SHELL_SUCCESS;
Language = NULL;
+ SfoFlag = FALSE;
//
// initialize the shell lib (we must be in non-auto-init...)
@@ -203,10 +207,13 @@ ShellCommandRunDevices ( //
// Print Header
- // only in non SFO mode.
+
//
- if (!ShellCommandLineGetFlag(Package, L"-sfo")){
- ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
+ if (ShellCommandLineGetFlag (Package, L"-sfo")) {
+ ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_GEN_SFO_HEADER), gShellDriver1HiiHandle, L"devices");
+ SfoFlag = TRUE;
+ } else {
+ ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
}
//
@@ -225,37 +232,20 @@ ShellCommandRunDevices ( Name = NULL;
Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language);
if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) {
- if (!ShellCommandLineGetFlag(Package, L"-sfo")){
- ShellPrintHiiEx(
- -1,
- -1,
- Language,
- STRING_TOKEN(STR_DEVICES_ITEM_LINE),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(*HandleListWalker),
- Type,
- Cfg?L'X':L'-',
- Diag?L'X':L'-',
- Parents,
- Devices,
- Children,
- Name != NULL ? Name : L"<UNKNOWN>");
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- Language,
- STRING_TOKEN(STR_DEVICES_ITEM_LINE_SFO),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(*HandleListWalker),
- Type,
- Cfg?L'Y':L'N',
- Diag?L'Y':L'N',
- Parents,
- Devices,
- Children,
- Name != NULL ? Name : L"<UNKNOWN>");
- }
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ Language,
+ SfoFlag?STRING_TOKEN (STR_DEVICES_ITEM_LINE_SFO):STRING_TOKEN (STR_DEVICES_ITEM_LINE),
+ gShellDriver1HiiHandle,
+ ConvertHandleToHandleIndex (*HandleListWalker),
+ Type,
+ Cfg?(SfoFlag?L'Y':L'X'):(SfoFlag?L'N':L'-'),
+ Diag?(SfoFlag?L'Y':L'X'):(SfoFlag?L'N':L'-'),
+ Parents,
+ Devices,
+ Children,
+ Name!=NULL?Name:L"<UNKNOWN>");
}
if (Name != NULL) {
FreePool(Name);
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni Binary files differindex 5655a4bf25..9e6e30080f 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni |