From cebd6ef9048067ab53ab03e344f9df2cb506080d Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Fri, 1 Aug 2014 04:44:16 +0000 Subject: Support --version command line for VfrCompile Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15733 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 20 ++++++++++++++++++++ BaseTools/Source/C/VfrCompile/VfrCompiler.h | 1 + 2 files changed, 21 insertions(+) diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp index ee10605edb..bb2df3ed39 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp @@ -96,6 +96,10 @@ CVfrCompiler::OptionInitialization ( Usage (); SET_RUN_STATUS (STATUS_DEAD); return; + } else if (stricmp(Argv[Index], "--version") == 0) { + Version (); + SET_RUN_STATUS (STATUS_DEAD); + return; } else if (stricmp(Argv[Index], "-l") == 0) { mOptions.CreateRecordListFile = TRUE; gCIfrRecordInfoDB.TurnOn (); @@ -415,6 +419,7 @@ CVfrCompiler::Usage ( " ", "Options:", " -h, --help prints this help", + " --version prints version info", " -l create an output IFR listing file", " -o DIR, --output-directory DIR", " 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 CVfrCompiler::PreProcess ( VOID diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source/C/VfrCompile/VfrCompiler.h index 3261e9ccdb..6a6779c0ca 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h @@ -100,6 +100,7 @@ public: ~CVfrCompiler (); VOID Usage (VOID); + VOID Version (VOID); VOID PreProcess (VOID); VOID Compile (VOID); -- cgit v1.2.3