- StrCpy(ShellInfoObject.ShellInitSettings.FileName, TempConst);\r
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup = 1;\r
- for (LoopVar = 0 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {\r
- if (StrCmp(gEfiShellParametersProtocol->Argv[LoopVar], ShellInfoObject.ShellInitSettings.FileName)==0) {\r
- LoopVar++;\r
- //\r
- // We found the file... add the rest of the params...\r
- //\r
- for ( ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {\r
- ASSERT((ShellInfoObject.ShellInitSettings.FileOptions == NULL && Size == 0) || (ShellInfoObject.ShellInitSettings.FileOptions != NULL));\r
- StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,\r
- &Size,\r
- L" ",\r
- 0);\r
- if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {\r
- SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);\r
- return (EFI_OUT_OF_RESOURCES);\r
- }\r
- StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,\r
- &Size,\r
- gEfiShellParametersProtocol->Argv[LoopVar],\r
- 0);\r
- if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {\r
- SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);\r
- return (EFI_OUT_OF_RESOURCES);\r
- }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-nostartup",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-noconsoleout",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-noconsolein",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-nointerrupt",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoInterrupt = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-nomap",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-noversion",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion = TRUE;\r
+ }\r
+ else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-delay",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = TRUE;\r
+ // Check for optional delay value following "-delay"\r
+ DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];\r
+ if (DelayValueStr != NULL){\r
+ if (*DelayValueStr == L':') {\r
+ DelayValueStr++;\r
+ }\r
+ if (!EFI_ERROR(ShellConvertStringToUint64 (\r
+ DelayValueStr,\r
+ &DelayValue,\r
+ FALSE,\r
+ FALSE\r
+ ))) {\r
+ ShellInfoObject.ShellInitSettings.Delay = (UINTN)DelayValue;\r
+ LoopVar++;\r
+ }\r
+ }\r
+ } else if (UnicodeCollation->StriColl (\r
+ UnicodeCollation,\r
+ L"-_exit",\r
+ CurrentArg\r
+ ) == 0) {\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit = TRUE;\r
+ } else if (StrnCmp (L"-", CurrentArg, 1) == 0) {\r
+ // Unrecognized option\r
+ ShellPrintHiiEx(-1, -1, NULL,\r
+ STRING_TOKEN (STR_GEN_PROBLEM),\r
+ ShellInfoObject.HiiHandle,\r
+ CurrentArg\r
+ );\r
+ return EFI_INVALID_PARAMETER;\r
+ } else {\r
+ //\r
+ // First argument should be Shell.efi image name\r
+ //\r
+ if (LoopVar == 0) {\r
+ continue;\r
+ }\r
+\r
+ ShellInfoObject.ShellInitSettings.FileName = AllocateCopyPool(StrSize(CurrentArg), CurrentArg);\r
+ if (ShellInfoObject.ShellInitSettings.FileName == NULL) {\r
+ return (EFI_OUT_OF_RESOURCES);\r
+ }\r
+ //\r
+ // We found `file-name`.\r
+ //\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup = 1;\r
+ LoopVar++;\r
+\r
+ // Add `file-name-options`\r
+ for (Size = 0 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {\r
+ ASSERT((ShellInfoObject.ShellInitSettings.FileOptions == NULL && Size == 0) || (ShellInfoObject.ShellInitSettings.FileOptions != NULL));\r
+ StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,\r
+ &Size,\r
+ L" ",\r
+ 0);\r
+ if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {\r
+ SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);\r
+ return (EFI_OUT_OF_RESOURCES);\r
+ }\r
+ StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,\r
+ &Size,\r
+ gEfiShellParametersProtocol->Argv[LoopVar],\r
+ 0);\r
+ if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {\r
+ SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);\r
+ return (EFI_OUT_OF_RESOURCES);\r