]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Added or modified utility version and usage display.
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jan 2007 22:09:16 +0000 (22:09 +0000)
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Jan 2007 22:09:16 +0000 (22:09 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2162 6f19259b-4bc3-4df7-8a09-765794883524

Tools/CCode/Source/GenBsfImage/GenBsfImage.c
Tools/CCode/Source/GenCRC32Section/GenCRC32Section.c
Tools/CCode/Source/GenCapsuleHdr/GenCapsuleHdr.c
Tools/CCode/Source/Strip/Strip.c

index 1c9dff92584696b727074384c367a73be22a6a4c..bc3ae9f2447eafb95208d9f9532e5b4a2b04b5c4 100644 (file)
@@ -2561,18 +2561,18 @@ Returns:
   //\r
   if (argc < 1) {\r
     Usage();\r
   //\r
   if (argc < 1) {\r
     Usage();\r
-    return -1;\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
   }\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
+    return 1;\r
   }\r
   \r
   if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
     Version();\r
   }\r
   \r
   if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
     Version();\r
-    return -1;\r
+    return 1;\r
   }\r
  \r
   if (argc != ONE_BSF_ARGS && argc != TWO_BSF_ARGS) {\r
   }\r
  \r
   if (argc != ONE_BSF_ARGS && argc != TWO_BSF_ARGS) {\r
index b99cf2f81643e506a6cd3dafbdc90f682b70def0..5c9af78181c5b0ac1401cc40f6b5163894515250 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\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
 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
@@ -22,9 +22,9 @@ Abstract:
 \r
 #include "GenCRC32Section.h"\r
 \r
 \r
 #include "GenCRC32Section.h"\r
 \r
-#define TOOLVERSION   "0.2"\r
-\r
-#define UTILITY_NAME  "GenCrc32Section"\r
+#define UTILITY_NAME           "GenCrc32Section"\r
+#define UTILITY_MAJOR_VERSION  0\r
+#define UTILITY_MINOR_VERSION  2\r
 \r
 EFI_GUID  gEfiCrc32SectionGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
 \r
 \r
 EFI_GUID  gEfiCrc32SectionGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
 \r
@@ -117,16 +117,45 @@ Returns:
 }\r
 \r
 VOID\r
 }\r
 \r
 VOID\r
-PrintUsage (\r
+Version (\r
   VOID\r
   )\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
 {\r
-  printf ("Usage:\n");\r
-  printf (UTILITY_NAME " -i \"inputfile1\" \"inputfile2\" -o \"outputfile\" \n");\r
-  printf ("   -i \"inputfile\":\n ");\r
-  printf ("       specifies the input files that would be signed to CRC32 Guided section.\n");\r
-  printf ("   -o \"outputfile\":\n");\r
-  printf ("       specifies the output file that is a CRC32 Guided section.\n");\r
+  printf (\r
+    "%s v%d.%d -Utility for generating Firmware File System files.\n",\r
+    UTILITY_NAME,\r
+    UTILITY_MAJOR_VERSION,\r
+    UTILITY_MINOR_VERSION\r
+    );\r
+}\r
+\r
+\r
+VOID\r
+Usage (\r
+  VOID\r
+  )\r
+{\r
+  Version();\r
+  \r
+  printf ("\nUsage:\n");\r
+  printf (UTILITY_NAME " -i Inputfile1 Inputfile2 -o Outputfile\n");\r
+  printf ("   -i Inputfile: specifies the input files signed to CRC32 Guided section.\n");\r
+  printf ("   -o Outputfile: specifies the output file that is a CRC32 Guided section.\n");\r
 }\r
 \r
 INT32\r
 }\r
 \r
 INT32\r
@@ -211,8 +240,19 @@ main (
 \r
   SetUtilityName (UTILITY_NAME);\r
 \r
 \r
   SetUtilityName (UTILITY_NAME);\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 == 1) {\r
   if (argc == 1) {\r
-    PrintUsage ();\r
+    Usage ();\r
     return -1;\r
   }\r
 \r
     return -1;\r
   }\r
 \r
index d1f55b9abd44c54bb2b9f119dfe3de7fe874062a..97482f2cebcd0cd140b1a2ed356e408ea1734960 100644 (file)
@@ -41,7 +41,10 @@ Abstract:
 #include "EfiUtilityMsgs.h"\r
 \r
 #define MAX_PATH                  256\r
 #include "EfiUtilityMsgs.h"\r
 \r
 #define MAX_PATH                  256\r
-#define PROGRAM_NAME              "GenCapsuleHdr"\r
+\r
+#define UTILITY_NAME              "GenCapsuleHdr"\r
+#define UTILITY_MAJOR_VERSION     1\r
+#define UTILITY_MINOR_VERSION     0\r
 \r
 #define UNICODE_BACKSLASH         L'\\'\r
 #define UNICODE_FILE_START        0xFEFF\r
 \r
 #define UNICODE_BACKSLASH         L'\\'\r
 #define UNICODE_FILE_START        0xFEFF\r
@@ -158,6 +161,12 @@ SplitCapsule (
   INT8 *CapsuleFileName\r
   );\r
 \r
   INT8 *CapsuleFileName\r
   );\r
 \r
+static\r
+void\r
+Version (\r
+  VOID\r
+  );\r
+\r
 static\r
 void\r
 Usage (\r
 static\r
 void\r
 Usage (\r
@@ -273,7 +282,7 @@ Returns:
   //\r
   // Specify our program name to the error printing routines.\r
   //\r
   //\r
   // Specify our program name to the error printing routines.\r
   //\r
-  SetUtilityName (PROGRAM_NAME);\r
+  SetUtilityName (UTILITY_NAME);\r
   //\r
   // Process the command-line arguments\r
   //\r
   //\r
   // Process the command-line arguments\r
   //\r
@@ -2355,10 +2364,22 @@ Returns:
   Argc--;\r
   Argv++;\r
 \r
   Argc--;\r
   Argv++;\r
 \r
-  if (Argc == 0) {\r
+  if (Argc < 1) {\r
     Usage ();\r
     return STATUS_ERROR;\r
   }\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
   // Process until no more options\r
   //\r
   //\r
   // Process until no more options\r
   //\r
@@ -2622,6 +2643,31 @@ Returns:
   return STATUS_SUCCESS;\r
 }\r
 \r
   return STATUS_SUCCESS;\r
 }\r
 \r
+static\r
+void \r
+Version(\r
+  void\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Print out version information for this utility.\r
+\r
+Arguments:\r
+\r
+  None\r
+  \r
+Returns:\r
+\r
+  None\r
+  \r
+--*/ \r
+{\r
+  printf ("%s v%d.%d -EDK utility to create a capsule header.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2006 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
 static\r
 void\r
 Usage (\r
 static\r
 void\r
 Usage (\r
@@ -2645,13 +2691,13 @@ Returns:
 {\r
   int               Index;\r
   static const char *Str[] = {\r
 {\r
   int               Index;\r
   static const char *Str[] = {\r
-    PROGRAM_NAME " -- create a capsule header",\r
-    "  Usage: "PROGRAM_NAME " {options} [CapsuleFV]",\r
+    "\nUsage: "UTILITY_NAME " {options} [CapsuleFV]",\r
     //\r
     // {FfsFileNames}",\r
     //\r
     "    Options include:",\r
     //\r
     // {FfsFileNames}",\r
     //\r
     "    Options include:",\r
-    "      -h or -?         for this help information",\r
+    "      -h,--help,-?,/?  to display help messages",\r
+    "      -V,--version     to display version information",\r
     "      -script fname    to take capsule header info from unicode script",\r
     "                       file fname",\r
     "      -o fname         write output to file fname (required)",\r
     "      -script fname    to take capsule header info from unicode script",\r
     "                       file fname",\r
     "      -o fname         write output to file fname (required)",\r
@@ -2668,6 +2714,9 @@ Returns:
     //\r
     NULL\r
   };\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
   for (Index = 0; Str[Index] != NULL; Index++) {\r
     fprintf (stdout, "%s\n", Str[Index]);\r
   }\r
index 6215ca8fc4a491292ed22d13cf6943b0a2f847d8..f7820bcfaf46bdb96c866eda354a93deb218e560 100644 (file)
@@ -50,7 +50,7 @@ Returns:
   \r
 --*/ \r
 {\r
   \r
 --*/ \r
 {\r
-  printf ("%s v%d.%d -EDK Convert EXE to BIN\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("%s v%d.%d -EDK Utility to Convert EXE to BIN\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
   printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
   printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r