diff options
author | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-09 22:29:27 +0000 |
---|---|---|
committer | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-09 22:29:27 +0000 |
commit | 60db81c16b79e22ec1a883ab55b231d34d5b926b (patch) | |
tree | b9a639166543800694e01b8d0b103c8336a3b41b /Tools/CCode/Source/GuidChk | |
parent | 18a964cf709bcfe16f98a7019fa46d199b916cc6 (diff) | |
download | edk2-platforms-60db81c16b79e22ec1a883ab55b231d34d5b926b.tar.xz |
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2201 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/GuidChk')
-rw-r--r-- | Tools/CCode/Source/GuidChk/GuidChk.c | 76 |
1 files changed, 64 insertions, 12 deletions
diff --git a/Tools/CCode/Source/GuidChk/GuidChk.c b/Tools/CCode/Source/GuidChk/GuidChk.c index de88405872..ab2d767b80 100644 --- a/Tools/CCode/Source/GuidChk/GuidChk.c +++ b/Tools/CCode/Source/GuidChk/GuidChk.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2004, Intel Corporation
+Copyright (c) 2004 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -33,6 +33,11 @@ Abstract: // Define a structure that correlates filename extensions to an enumerated
// type.
//
+
+#define UTILITY_NAME "GuidChk"
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 0
+
typedef struct {
INT8 *Extension;
INT8 ExtensionCode;
@@ -121,6 +126,12 @@ ProcessArgs ( static
VOID
+Version (
+ VOID
+ );
+
+static
+VOID
Usage (
VOID
);
@@ -352,7 +363,18 @@ ProcessArgs ( Usage ();
return STATUS_ERROR;
}
-
+
+ if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||
+ (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {
+ Usage();
+ return STATUS_ERROR;
+ }
+
+ if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {
+ Version();
+ return STATUS_ERROR;
+ }
+
while (Argc > 0) {
//
// Look for options
@@ -570,6 +592,32 @@ ProcessArgs ( return STATUS_SUCCESS;
}
+
+static
+void
+Version(
+ void
+)
+/*++
+
+Routine Description:
+
+ Displays the standard utility information to SDTOUT
+
+Arguments:
+
+ None
+
+Returns:
+
+ None
+
+--*/
+{
+ printf ("%s v%d.%d -Utility for checking guid duplication for files in a given directory.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+}
+
//
// Print usage instructions
//
@@ -585,21 +633,25 @@ Usage ( "",
"Usage: GuidChk {options}\n",
" Options: ",
- " -d dirname exclude searching of a directory",
- " -f filename exclude searching of a file",
- " -e extension exclude searching of files by extension",
- " -p print all GUIDS found",
- " -g check for duplicate guids",
- " -s check for duplicate signatures",
- " -x print guid+defined symbol name",
- " -b outfile write internal GUID+basename list to outfile",
- " -u dirname exclude searching all subdirectories of a directory",
- " -h -? print this help text",
+ " -d dirname exclude searching of a directory",
+ " -f filename exclude searching of a file",
+ " -e extension exclude searching of files by extension",
+ " -p print all GUIDS found",
+ " -g check for duplicate guids",
+ " -s check for duplicate signatures",
+ " -x print guid+defined symbol name",
+ " -b outfile write internal GUID+basename list to outfile",
+ " -u dirname exclude searching all subdirectories of a directory",
+ " -h,--help,-?,/? display help messages",
+ " -V,--version display version information",
" ",
" Example: GuidChk -g -u build -d fv -f make.inf -e .pkg",
"",
NULL
};
+
+ Version();
+
for (Index = 0; Str[Index] != NULL; Index++) {
fprintf (stdout, "%s\n", Str[Index]);
}
|