]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Support --version command line for VfrCompile
authorEric Dong <eric.dong@intel.com>
Fri, 1 Aug 2014 04:44:16 +0000 (04:44 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Aug 2014 04:44:16 +0000 (04:44 +0000)
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

BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTools/Source/C/VfrCompile/VfrCompiler.h

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