From: ywang Date: Wed, 17 Jan 2007 21:46:35 +0000 (+0000) Subject: Modified the version and usage display. X-Git-Tag: edk2-stable201903~23614 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=26355eed4310bfecea4a44d146919955c9be7861 Modified the version and usage display. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2263 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c b/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c index caf129b429..33d2c61e25 100644 --- a/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c +++ b/Tools/CCode/Source/ZeroDebugData/ZeroDebugData.c @@ -24,8 +24,35 @@ Abstract: #include #include +#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 [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 //