Support --version command line for VfrCompile

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15733 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2014-08-01 04:44:16 +00:00 committed by ydong10
parent 46737a64d0
commit cebd6ef904
2 changed files with 21 additions and 0 deletions

View File

@ -96,6 +96,10 @@ CVfrCompiler::OptionInitialization (
Usage (); Usage ();
SET_RUN_STATUS (STATUS_DEAD); SET_RUN_STATUS (STATUS_DEAD);
return; return;
} else if (stricmp(Argv[Index], "--version") == 0) {
Version ();
SET_RUN_STATUS (STATUS_DEAD);
return;
} else if (stricmp(Argv[Index], "-l") == 0) { } else if (stricmp(Argv[Index], "-l") == 0) {
mOptions.CreateRecordListFile = TRUE; mOptions.CreateRecordListFile = TRUE;
gCIfrRecordInfoDB.TurnOn (); gCIfrRecordInfoDB.TurnOn ();
@ -415,6 +419,7 @@ CVfrCompiler::Usage (
" ", " ",
"Options:", "Options:",
" -h, --help prints this help", " -h, --help prints this help",
" --version prints version info",
" -l create an output IFR listing file", " -l create an output IFR listing file",
" -o DIR, --output-directory DIR", " -o DIR, --output-directory DIR",
" deposit all output files to directory OutputDir", " deposit all output files to directory OutputDir",
@ -439,6 +444,21 @@ CVfrCompiler::Usage (
} }
} }
VOID
CVfrCompiler::Version (
VOID
)
{
UINT32 Index;
CONST CHAR8 *Help[] = {
"VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION,
NULL
};
for (Index = 0; Help[Index] != NULL; Index++) {
fprintf (stdout, "%s\n", Help[Index]);
}
}
VOID VOID
CVfrCompiler::PreProcess ( CVfrCompiler::PreProcess (
VOID VOID

View File

@ -100,6 +100,7 @@ public:
~CVfrCompiler (); ~CVfrCompiler ();
VOID Usage (VOID); VOID Usage (VOID);
VOID Version (VOID);
VOID PreProcess (VOID); VOID PreProcess (VOID);
VOID Compile (VOID); VOID Compile (VOID);