]> git.proxmox.com Git - mirror_edk2.git/commitdiff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2201 6f19259b...
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Jan 2007 22:29:27 +0000 (22:29 +0000)
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Jan 2007 22:29:27 +0000 (22:29 +0000)
Tools/CCode/Source/GenCapsuleHdr/GenCapsuleHdr.c
Tools/CCode/Source/GuidChk/GuidChk.c
Tools/CCode/Source/MakeDeps/MakeDeps.c
Tools/CCode/Source/SecApResetVectorFixup/SecApResetVectorFixup.c

index 16b15c3d66969be6c5627b910e48c2a99edeae4b..6f182615a64d8377fec178bc4210f84476b7ae10 100644 (file)
@@ -2364,7 +2364,7 @@ Returns:
   Argc--;\r
   Argv++;\r
 \r
-  if (Argc < 1) {\r
+  if (Argc == 0) {\r
     Usage ();\r
     return STATUS_ERROR;\r
   }\r
index de884058720c49898a2fb65c9e03705a87d51895..ab2d767b80f8bacf60fd1a41a9391d4ba568e307 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation                                                         \r
+Copyright (c) 2004 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -33,6 +33,11 @@ Abstract:
 // Define a structure that correlates filename extensions to an enumerated\r
 // type.\r
 //\r
+\r
+#define UTILITY_NAME              "GuidChk"\r
+#define UTILITY_MAJOR_VERSION     1\r
+#define UTILITY_MINOR_VERSION     0\r
+\r
 typedef struct {\r
   INT8  *Extension;\r
   INT8  ExtensionCode;\r
@@ -119,6 +124,12 @@ ProcessArgs (
   char    *Argv[]\r
   );\r
 \r
+static\r
+VOID\r
+Version (\r
+  VOID\r
+  );\r
+\r
 static\r
 VOID\r
 Usage (\r
@@ -352,7 +363,18 @@ ProcessArgs (
     Usage ();\r
     return STATUS_ERROR;\r
   }\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
   while (Argc > 0) {\r
     //\r
     // Look for options\r
@@ -570,6 +592,32 @@ ProcessArgs (
 \r
   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 for checking guid duplication for files in a given directory.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
 //\r
 // Print usage instructions\r
 //\r
@@ -585,21 +633,25 @@ Usage (
     "",\r
     "Usage:  GuidChk {options}\n",\r
     "  Options: ",\r
-    "    -d dirname     exclude searching of a directory",\r
-    "    -f filename    exclude searching of a file",\r
-    "    -e extension   exclude searching of files by extension",\r
-    "    -p             print all GUIDS found",\r
-    "    -g             check for duplicate guids",\r
-    "    -s             check for duplicate signatures",\r
-    "    -x             print guid+defined symbol name",\r
-    "    -b outfile     write internal GUID+basename list to outfile",\r
-    "    -u dirname     exclude searching all subdirectories of a directory",\r
-    "    -h -?          print this help text",\r
+    "    -d dirname      exclude searching of a directory",\r
+    "    -f filename     exclude searching of a file",\r
+    "    -e extension    exclude searching of files by extension",\r
+    "    -p              print all GUIDS found",\r
+    "    -g              check for duplicate guids",\r
+    "    -s              check for duplicate signatures",\r
+    "    -x              print guid+defined symbol name",\r
+    "    -b outfile      write internal GUID+basename list to outfile",\r
+    "    -u dirname      exclude searching all subdirectories of a directory",\r
+    "    -h,--help,-?,/? display help messages",\r
+    "    -V,--version    display version information",\r
     " ",\r
     "   Example: GuidChk -g -u build -d fv -f make.inf -e .pkg",\r
     "",\r
     NULL\r
   };\r
+  \r
+  Version();\r
+  \r
   for (Index = 0; Str[Index] != NULL; Index++) {\r
     fprintf (stdout, "%s\n", Str[Index]);\r
   }\r
index 3943df065426d7c1753a921bfda417515f636217..9eb0425a26e826ee7f6e32bd5b4235b1c1db424a 100755 (executable)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation                                                         \r
+Copyright (c) 2004 - 20077, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -38,7 +38,9 @@ typedef struct _STRING_LIST {
   char                *Str;\r
 } STRING_LIST;\r
 \r
-#define UTILITY_NAME      "MakeDeps"\r
+#define UTILITY_NAME              "MakeDeps"\r
+#define UTILITY_MAJOR_VERSION     1\r
+#define UTILITY_MINOR_VERSION     0\r
 \r
 #define MAX_LINE_LEN      2048\r
 #define MAX_PATH          2048\r
@@ -163,6 +165,12 @@ ProcessArgs (
   char  *Argv[]\r
   );\r
 \r
+static\r
+void\r
+Version (\r
+  VOID\r
+  );\r
+\r
 static\r
 void\r
 Usage (\r
@@ -828,6 +836,23 @@ ProcessArgs (
   //\r
   Argc--;\r
   Argv++;\r
+  \r
+  if (Argc == 0) {\r
+    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
   // Initialize locals\r
   //\r
@@ -1233,6 +1258,31 @@ FreeLists (
   //\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 for generating file dependency lists for files in a given directory.\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
@@ -1259,7 +1309,8 @@ Returns:
     UTILITY_NAME " -- make dependencies",\r
     "  Usage: MakeDeps [options]",\r
     "    Options include:",\r
-    "      -h or -?         for this help information",\r
+    "      -h,--help,-?,/?  display help messages",\r
+    "      -V,--version     display version information",\r
     "      -f SourceFile    add SourceFile to list of files to scan",\r
     "      -i IncludePath   add IncludePath to list of search paths",\r
     "      -o OutputFile    write output dependencies to OutputFile",\r
@@ -1278,6 +1329,9 @@ Returns:
     "",\r
     NULL\r
   };\r
+  \r
+  Version();\r
+  \r
   for (Index = 0; Str[Index] != NULL; Index++) {\r
     fprintf (stdout, "%s\n", Str[Index]);\r
   }\r
index 442645720eed03fe56fb7ec256e77f43e59675c2..06d3f3344a0110ac4c5357e40d51f9e979c87ef0 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c)  2004-2006 Intel Corporation. All rights reserved\r
+Copyright (c)  2004-2007 Intel Corporation. All rights reserved\r
 This program and the accompanying materials are licensed and made available \r
 under the terms and conditions of the BSD License which accompanies this \r
 distribution.  The full text of the license may be found at\r
@@ -63,7 +63,7 @@ EFI_GUID  NewFvPadFileNameGuid     = { 0x145372bc, 0x66b9, 0x476d, 0x81, 0xbc, 0
 UINT8 ApResetVector[5] = {0xEA, 0xD0, 0xFF, 0x00, 0xF0};\r
 \r
 VOID\r
-PrintUtilityInfo (\r
+Version (\r
   VOID\r
   )\r
 /*++\r
@@ -82,16 +82,12 @@ Returns:
 \r
 --*/\r
 {\r
-  printf (\r
-    "%s - Tiano IA32 SEC Ap Reset Vector Fixup Utility."" Version %i.%i\n\n",\r
-    UTILITY_NAME,\r
-    UTILITY_MAJOR_VERSION,\r
-    UTILITY_MINOR_VERSION\r
-    );\r
+  printf ("%s v%d.%d -Tiano IA32 SEC Ap Reset Vector Fixup Utility.\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
@@ -110,10 +106,12 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("Usage: %s InputFvrecoveryFile OutputFvrecoveryFile\n", UTILITY_NAME);\r
+  Version();\r
+  \r
+  printf ("\nUsage: %s InputFvrecoveryFile OutputFvrecoveryFile\n", UTILITY_NAME);\r
   printf ("  Where:\n");\r
-  printf ("\tInputFvrecoveryFile   - Name of the IA32 input Fvrecovery.fv file.\n");\r
-  printf ("\tOutputFvrecoveryFile  - Name of the IA32 output Fvrecovery.fv file.\n");\r
+  printf ("    InputFvrecoveryFile   - Name of the IA32 input Fvrecovery.fv file.\n");\r
+  printf ("    OutputFvrecoveryFile  - Name of the IA32 output Fvrecovery.fv file.\n");\r
 }\r
 \r
 \r
@@ -216,17 +214,28 @@ Returns:
   TempGuid = NULL;\r
   SetUtilityName (UTILITY_NAME);\r
 \r
-  //\r
-  // Display utility information\r
-  //\r
-  PrintUtilityInfo ();\r
-\r
+  if (argc == 1) {\r
+    Usage();\r
+    return STATUS_ERROR;\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 STATUS_ERROR;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+    Version();\r
+    return STATUS_ERROR;\r
+  }\r
\r
   //\r
   // Verify the correct number of arguments\r
   //\r
   if (argc != MAX_ARGS) {\r
     Error (NULL, 0, 0, "invalid number of input parameters specified", NULL);\r
-    PrintUsage ();\r
+    Usage ();\r
     return STATUS_ERROR;\r
   }\r
   //\r