ShellPkg: Add Shell invocation option '-exit'

According to Shell spec 2.2 '-exit' invocation option is used to specify
that after running the command line when launched, the UEFI Shell must
immediately exit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Chen A Chen 2017-03-16 13:22:40 +08:00 committed by Ruiyu Ni
parent aaf51f08ee
commit 6ca29fa310
2 changed files with 3 additions and 3 deletions

View File

@ -1022,7 +1022,7 @@ ProcessCommandLine(
} }
} else if (UnicodeCollation->StriColl ( } else if (UnicodeCollation->StriColl (
UnicodeCollation, UnicodeCollation,
L"-_exit", L"-exit",
CurrentArg CurrentArg
) == 0) { ) == 0) {
ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit = TRUE; ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit = TRUE;

View File

@ -4,7 +4,7 @@
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1781,7 +1781,7 @@ EfiShellExecute(
Temp = NULL; Temp = NULL;
Size = 0; Size = 0;
ASSERT((Temp == NULL && Size == 0) || (Temp != NULL)); ASSERT((Temp == NULL && Size == 0) || (Temp != NULL));
StrnCatGrow(&Temp, &Size, L"Shell.efi -_exit ", 0); StrnCatGrow(&Temp, &Size, L"Shell.efi -exit ", 0);
StrnCatGrow(&Temp, &Size, CommandLine, 0); StrnCatGrow(&Temp, &Size, CommandLine, 0);
Status = InternalShellExecuteDevicePath( Status = InternalShellExecuteDevicePath(