]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c
Modified the version and usage display.
[mirror_edk2.git] / Tools / CCode / Source / ZeroDebugData / ZeroDebugData.c
index caf129b429c205f14b56c8386c0fa9c22e3f1432..33d2c61e258f6b4ee811efbb279a3e44a10e6afd 100644 (file)
@@ -24,8 +24,35 @@ Abstract:
 #include <string.h>\r
 #include <stdlib.h>\r
 \r
+#define UTILITY_NAME    "GenTEImage"\r
+#define UTILITY_MAJOR_VERSION   0\r
+#define UTILITY_MINOR_VERSION   1\r
+\r
+void\r
+Version (\r
+  void\r
+  )\r
+/*++\r
+Routine Description:\r
+  print version information for this utility\r
+\r
+Arguments:\r
+  None\r
+\r
+Returns:\r
+  None\r
+--*/\r
+// GC_TODO:    void - add argument and description to function comment\r
+{\r
+  //\r
+  // print usage of command\r
+  //\r
+  printf ("%s v%d.%d -Utility to zero the Debug Data Fields of Portable Executable (PE) format file.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
 void\r
-PrintUsage (\r
+Usage (\r
   void\r
   )\r
 /*++\r
@@ -40,6 +67,7 @@ Returns:
 --*/\r
 // GC_TODO:    void - add argument and description to function comment\r
 {\r
+  Version();\r
   //\r
   // print usage of command\r
   //\r
@@ -334,13 +362,27 @@ Returns:
   FILE  *fpData;\r
   char  DataFile[1024] = "";\r
 \r
-  //\r
-  // check the number of parameters\r
-  //\r
-  if (argc < 2) {\r
-    printf ("\nUsage: ZeroDebugData <PE-File> [DebugData-File]\n");\r
+  if (argc == 1) {\r
+    Usage();\r
     return -1;\r
   }\r
+    \r
+  if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+      (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+    Usage();\r
+    return -1;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+    Version();\r
+    return -1;\r
+  }\r
+\r
+  if (argc == 2) {\r
+    Usage();\r
+    return -1;\r
+  }\r
+\r
   //\r
   // open the DebugData file, if not exists, return\r
   //\r