summaryrefslogtreecommitdiff
path: root/Tools/CCode
diff options
context:
space:
mode:
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-17 21:46:35 +0000
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-17 21:46:35 +0000
commit26355eed4310bfecea4a44d146919955c9be7861 (patch)
tree63ee4edc0eea17922bc32354468983f740cda3f0 /Tools/CCode
parent243009a7bf0cbd4a40815343d132481031f128c2 (diff)
downloadedk2-26355eed4310bfecea4a44d146919955c9be7861.zip
edk2-26355eed4310bfecea4a44d146919955c9be7861.tar.gz
edk2-26355eed4310bfecea4a44d146919955c9be7861.tar.bz2
Modified the version and usage display.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2263 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode')
-rw-r--r--Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c b/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c
index caf129b..33d2c61 100644
--- a/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c
+++ b/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c
@@ -24,8 +24,35 @@ Abstract:
#include <string.h>
#include <stdlib.h>
+#define UTILITY_NAME "GenTEImage"
+#define UTILITY_MAJOR_VERSION 0
+#define UTILITY_MINOR_VERSION 1
+
+void
+Version (
+ void
+ )
+/*++
+Routine Description:
+ print version information for this utility
+
+Arguments:
+ None
+
+Returns:
+ None
+--*/
+// GC_TODO: void - add argument and description to function comment
+{
+ //
+ // print usage of command
+ //
+ 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);
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+}
+
void
-PrintUsage (
+Usage (
void
)
/*++
@@ -40,6 +67,7 @@ Returns:
--*/
// GC_TODO: void - add argument and description to function comment
{
+ Version();
//
// print usage of command
//
@@ -334,13 +362,27 @@ Returns:
FILE *fpData;
char DataFile[1024] = "";
- //
- // check the number of parameters
- //
- if (argc < 2) {
- printf ("\nUsage: ZeroDebugData <PE-File> [DebugData-File]\n");
+ if (argc == 1) {
+ Usage();
return -1;
}
+
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {
+ Usage();
+ return -1;
+ }
+
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {
+ Version();
+ return -1;
+ }
+
+ if (argc == 2) {
+ Usage();
+ return -1;
+ }
+
//
// open the DebugData file, if not exists, return
//