audk/ShellPkg/Application/Shell
Jaben Carsey 806c49db05 ShellPkg: Refactor the RunCommand API
This almost completely splits the RunCommand API into sub-routines.

 - the ProcessCommandLineToFinal API handles replacing the a found alias and any found environment variables.  This will redirect "-?" to "help", if necessary.  Upon return, the command line is complete and finalized.  It may still have redirection in it, and those will get chopped off later (but no further modifications occur).
 - the SetupAndRunCommandOrFile API handles updating and then later restoring StdIn, StdOut, and StdErr (and removing their information from the command line).  It will call into RunCommandOrFile.
 - the RunCommandOrFile API divides the logic to RunInternalCommand, RunScriptFile, or running an .EFI file directly.
 - the RunInternalCommand API handles updating and then restoring Argc and Argv.  It will run the internal command in between.
 - the SetLastError API handles updating of the environment variable "lasterror"
 - the DoHelpUpdateArgcArgv was changed to DoHelpUpdate and now works on the raw command line and not the argc/argv.  This allows the processing to be moved earlier.

Note this change has the following positive side effects (this eliminates unnecessary step):
 - Argc/Argv are only updated for internal commands (as they are library based)
 - no Argv/Argc/StdIn/StdOut/StdErr processing is done for file system changes.
 - The ProcessCommandLineToFinal API exists and it's critical to the ability to correctly pre-process split ("|") command lines ahead of time to verify their correctness.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15007 6f19259b-4bc3-4df7-8a09-765794883524
2013-12-19 16:05:34 +00:00
..
ConsoleLogger.c ShellPkg: Stop running command when page break quit 2013-10-24 17:29:33 +00:00
ConsoleLogger.h ShellPkg: Clean up header file usage. 2012-11-13 22:39:09 +00:00
ConsoleWrappers.c Add a new line to initialize the variable “PassThruProtocol” in ConsoleWrapers.c to ensure the initialization not to be a part of its declaration. 2013-12-16 01:53:11 +00:00
ConsoleWrappers.h ShellPkg: Fixes the shell so output redirection works for the 'mode' command 2013-10-24 17:47:57 +00:00
FileHandleInternal.h Refine comments and two code style. 2011-09-02 08:05:34 +00:00
FileHandleWrappers.c ShellPkg: Remove trailing \r\n when redirect to env variable (EX: use ">v") 2013-11-22 21:15:19 +00:00
FileHandleWrappers.h udk2010.up2.shell initial release. 2010-09-14 05:18:09 +00:00
Shell.c ShellPkg: Refactor the RunCommand API 2013-12-19 16:05:34 +00:00
Shell.h ShellPkg: add API for determining operation type 2013-12-13 00:13:59 +00:00
Shell.inf ShellPkg: Fixes for shell application launch, argument handling, and version output: 2013-10-18 15:49:23 +00:00
Shell.uni ShellPkg: Fixes for shell application launch, argument handling, and version output: 2013-10-18 15:49:23 +00:00
ShellEnvVar.c ShellPkg: Clean up header file usage. 2012-11-13 22:39:09 +00:00
ShellEnvVar.h Refine comments and two code style. 2011-09-02 08:05:34 +00:00
ShellManParser.c Follow Shell specification to make sure the “command.man” file is always used no matter “command.efi -?” or “command -?” is typed. 2013-12-09 02:24:39 +00:00
ShellManParser.h udk2010.up2.shell initial release. 2010-09-14 05:18:09 +00:00
ShellParametersProtocol.c ShellPkg: add error messages into function 2013-12-13 23:53:59 +00:00
ShellParametersProtocol.h ShellPkg: Clean up header file usage. 2012-11-13 22:39:09 +00:00
ShellProtocol.c Follow Shell specification to make sure the “command.man” file is always used no matter “command.efi -?” or “command -?” is typed. 2013-12-09 02:24:39 +00:00
ShellProtocol.h ShellPkg: Clean up header file usage. 2012-11-13 22:39:09 +00:00