]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/GenTEImage/GenTEImage.c
Minor changes and bug fixes implemented.
[mirror_edk2.git] / Tools / CCode / Source / GenTEImage / GenTEImage.c
index 90f3b3919a689eb2fb588b42cb60e87e1c369b35..39b83326e2fb09f865a296ce50262001eeadd704 100644 (file)
@@ -34,7 +34,8 @@ Abstract:
 // Version of this utility\r
 //\r
 #define UTILITY_NAME    "GenTEImage"\r
-#define UTILITY_VERSION "v0.11"\r
+#define UTILITY_MAJOR_VERSION   0\r
+#define UTILITY_MINOR_VERSION   11\r
 \r
 //\r
 // Define the max length of a filename\r
@@ -84,6 +85,12 @@ static STRING_LOOKUP  mSubsystemTypes[] = {
 //\r
 //  Function prototypes\r
 //\r
+static\r
+void\r
+Version (\r
+  VOID\r
+  );\r
+\r
 static\r
 void\r
 Usage (\r
@@ -669,6 +676,18 @@ Returns:
     Usage ();\r
     return STATUS_ERROR;\r
   }\r
+  \r
+  if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||\r
+      (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {\r
+    Usage();\r
+    return STATUS_ERROR;\r
+  }\r
+  \r
+  if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {\r
+    Version();\r
+    return STATUS_ERROR;\r
+  }\r
+  \r
   //\r
   // Process until no more arguments\r
   //\r
@@ -733,6 +752,31 @@ Returns:
   return STATUS_SUCCESS;\r
 }\r
 \r
+static\r
+void \r
+Version(\r
+  void\r
+)\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Displays the standard utility information to SDTOUT\r
+\r
+Arguments:\r
+\r
+  None\r
+\r
+Returns:\r
+\r
+  None\r
+\r
+--*/\r
+{\r
+  printf ("%s v%d.%d -Utility to generate a TE image from an EFI PE32 image.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
 static\r
 void\r
 Usage (\r
@@ -756,19 +800,21 @@ Returns:
 {\r
   int               Index;\r
   static const char *Msg[] = {\r
-    UTILITY_NAME " version "UTILITY_VERSION " - TE image utility",\r
-    "  Generate a TE image from an EFI PE32 image",\r
-    "  Usage: "UTILITY_NAME " {-v} {-dump} {-h|-?} {-o OutFileName} InFileName",\r
+    "\nUsage: "UTILITY_NAME " {-v} {-dump} {-h|-?} {-o OutFileName} InFileName",\r
     "                [-e|-b] [FileName(s)]",\r
     "    where:",\r
+    "      -h,--help,-?,/?  to display help messages",\r
+    "      -V,--version     to display version information",\r
     "      -v             - for verbose output",\r
     "      -dump          - to dump the input file to a text file",\r
-    "      -h -?          - for this help information",\r
     "      -o OutFileName - to write output to OutFileName rather than InFileName"DEFAULT_OUTPUT_EXTENSION,\r
     "      InFileName     - name of the input PE32 file",\r
     "",\r
     NULL\r
   };\r
+  \r
+  Version();\r
+  \r
   for (Index = 0; Msg[Index] != NULL; Index++) {\r
     fprintf (stdout, "%s\n", Msg[Index]);\r
   }\r