/** @file\r
Main file for attrib shell level 2 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
- if (StrDecimalToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {\r
+ if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1);\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
- switch (StrDecimalToUintn(Param1)) {\r
+ switch (ShellStrToUintn(Param1)) {\r
case 0:\r
Background = EFI_BACKGROUND_BLACK;\r
break;\r
Background = EFI_BACKGROUND_LIGHTGRAY;\r
break;\r
}\r
- ForeColor = (~StrDecimalToUintn(Param1)) & 0xF;\r
+ ForeColor = (~ShellStrToUintn(Param1)) & 0xF;\r
Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background);\r
ASSERT_EFI_ERROR(Status);\r
Status = gST->ConOut->ClearScreen (gST->ConOut);\r
/** @file\r
Main file for Echo shell level 3 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
EFI_STATUS Status;\r
LIST_ENTRY *Package;\r
-// CHAR16 *ProblemParam;\r
SHELL_STATUS ShellStatus;\r
UINTN ParamCount;\r
+ CHAR16 *ProblemParam;\r
\r
-// ProblemParam = NULL;\r
+ ProblemParam = NULL;\r
ShellStatus = SHELL_SUCCESS;\r
\r
//\r
//\r
// parse the command line\r
//\r
- Status = ShellCommandLineParseEx (ParamList, &Package, NULL, TRUE, TRUE);\r
-// if (EFI_ERROR(Status)) {\r
-// if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
-// ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);\r
-// FreePool(ProblemParam);\r
-// ShellStatus = SHELL_INVALID_PARAMETER;\r
-// } else {\r
-// ASSERT(FALSE);\r
-// }\r
-// } else {\r
+ Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE);\r
+ if (EFI_ERROR(Status)) {\r
+ if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);\r
+ FreePool(ProblemParam);\r
+ ShellStatus = SHELL_INVALID_PARAMETER;\r
+ } else {\r
+ ASSERT(FALSE);\r
+ }\r
+ } else {\r
//\r
// check for "-?"\r
//\r
// free the command line package\r
//\r
ShellCommandLineFreeVarList (Package);\r
-// }\r
+ }\r
\r
return (ShellStatus);\r
}\r
/** @file\r
Main file for Help shell level 3 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {\r
{L"-usage", TypeFlag},\r
- {L"-section", TypeValue},\r
+ {L"-section", TypeMaxValue},\r
{L"-verbose", TypeFlag},\r
{L"-v", TypeFlag},\r
{NULL, TypeMax}\r
FreePool(HiiString);\r
Found = TRUE;\r
} else {\r
- CommandList = ShellCommandGetCommandList();\r
+ CommandList = ShellCommandGetCommandList(TRUE);\r
ASSERT(CommandList != NULL);\r
for ( Node = (COMMAND_LIST*)GetFirstNode(&CommandList->Link)\r
; CommandList != NULL && !IsListEmpty(&CommandList->Link) && !IsNull(&CommandList->Link, &Node->Link)\r
; Node = (COMMAND_LIST*)GetNextNode(&CommandList->Link, &Node->Link)\r
){\r
- if (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) {\r
+ if ((gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) ||\r
+ (gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL) != NULL && (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, (CHAR16*)(gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL)))))) {\r
//\r
// We have a command to look for help on.\r
//\r
Status = gEfiShellProtocol->GetHelpText(Node->CommandString, SectionToGetHelpOn, &OutText);\r
if (EFI_ERROR(Status) || OutText == NULL) {\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);\r
+ if (Status == EFI_DEVICE_ERROR) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_INV), gShellLevel3HiiHandle, Node->CommandString);\r
+ } else {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);\r
+ }\r
ShellStatus = SHELL_NOT_FOUND;\r
} else {\r
while (OutText[StrLen(OutText)-1] == L'\r' || OutText[StrLen(OutText)-1] == L'\n' || OutText[StrLen(OutText)-1] == L' ') {\r
/** @file\r
Main file for Touch shell level 3 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
#include <Library/ShellLib.h>\r
\r
+/**\r
+ Do the touch operation on a single handle.\r
+\r
+ @param[in] Handle The handle to update the date/time on.\r
+\r
+ @retval EFI_ACCESS_DENIED The file referenced by Handle is read only.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
TouchFileByHandle (\r
return (Status);\r
}\r
\r
+/**\r
+ Touch a given file and potantially recurse down if it was a directory.\r
+\r
+ @param[in] Name The name of this file.\r
+ @param[in] FS The name of the file system this file is on.\r
+ @param[in] Handle The handle of this file already opened.\r
+ @param[in] Rec TRUE to recurse if possible.\r
+\r
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
DoTouchByHandle (\r
/** @file\r
Main file for Type shell level 3 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
#include <Library/ShellLib.h>\r
\r
+/**\r
+ Display a single file to StdOut.\r
+\r
+ If both Ascii and UCS2 are FALSE attempt to discover the file type.\r
+\r
+ @param[in] Handle The handle to the file to display.\r
+ @param[in] Ascii TRUE to force ASCII, FALSE othewise.\r
+ @param[in] UCS2 TRUE to force UCS2, FALSE othewise.\r
+\r
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
TypeFileByHandle (\r
CHAR16 AsciiChar;\r
\r
ReadSize = PcdGet16(PcdShellFileOperationSize);\r
- Buffer = AllocatePool(ReadSize);\r
+ Buffer = AllocateZeroPool(ReadSize);\r
if (Buffer == NULL) {\r
return (EFI_OUT_OF_RESOURCES);\r
}\r
}\r
\r
if (!(Ascii|UCS2)){\r
- if (*(UINT16*)Buffer == UnicodeFileTag) {\r
+ if (*(UINT16*)Buffer == gUnicodeFileTag) {\r
UCS2 = TRUE;\r
Buffer = ((UINT16*)Buffer) + 1;\r
} else {\r
Print(L"%s", Buffer);\r
}\r
}\r
- Status = Print(L"\r\n", Buffer);\r
+ Print(L"\r\n", Buffer);\r
return (Status);\r
}\r
\r
){\r
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);\r
if (EFI_ERROR(Status)) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, (CHAR16*)Param);\r
ShellStatus = SHELL_NOT_FOUND;\r
break;\r
}\r
/** @file\r
Main file for NULL named library for level 3 shell command functions.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
0x4344558d, 0x4ef9, 0x4725, { 0xb1, 0xe4, 0x33, 0x76, 0xe8, 0xd6, 0x97, 0x4f } \\r
};\r
\r
+/**\r
+ return the filename to get help from is not using HII.\r
+\r
+ @retval The filename.\r
+**/\r
CONST CHAR16*\r
EFIAPI\r
ShellCommandGetManFileNameLevel3 (\r
\r
/**\r
Destructor for the library. free any resources.\r
+\r
+ @param ImageHandle The image handle of the process.\r
+ @param SystemTable The EFI System Table pointer.\r
**/\r
EFI_STATUS\r
EFIAPI\r
/** @file\r
header file for NULL named library for level 3 shell command functions.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
+#if !defined (_UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_)\r
+#define _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_\r
+\r
#include <Uefi.h>\r
#include <ShellBase.h>\r
\r
IN EFI_SYSTEM_TABLE *SystemTable\r
);\r
\r
+#endif\r
+\r