]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Tools/Source/GenSection/GenSection.c
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / GenSection / GenSection.c
index 1d1c307e87526091235f4f1ab9cb939c158b6ed0..fd367c3d620acbfd59f8ff0e1cc018e12ae7588e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -35,6 +35,7 @@ Abstract:
 #include EFI_PROTOCOL_DEFINITION (GuidedSectionExtraction)\r
 \r
 #define UTILITY_NAME            "GenSection"\r
+#define UTILITY_VERSION         "v1.0"\r
 \r
 #define PARAMETER_NOT_SPECIFIED "Parameter not specified"\r
 #define MAXIMUM_INPUT_FILE_NUM  10\r
@@ -81,37 +82,52 @@ PrintUsageMessage (
   VOID\r
   )\r
 {\r
-  UINTN SectionType;\r
-  UINTN DisplayCount;\r
-\r
-  printf ("Usage: "UTILITY_NAME "  -i InputFile -o OutputFile -s SectionType [SectionType params]\n\n");\r
-  printf ("    Where SectionType is one of the following section types:\n\n");\r
+  UINTN       SectionType;\r
+  int         Index;\r
+  const char  *Str[] = {\r
+    UTILITY_NAME" "UTILITY_VERSION" - Intel Generate Section Utility",\r
+    "  Copyright (C), 2004 - 2008 Intel Corporation",\r
+    \r
+#if ( defined(UTILITY_BUILD) && defined(UTILITY_VENDOR) )\r
+    "  Built from "UTILITY_BUILD", project of "UTILITY_VENDOR,\r
+#endif\r
+    "",\r
+    "Usage:",\r
+    "  "UTILITY_NAME" [OPTION]",\r
+    "Common Options:",\r
+    "  -i InputFile    Specifies the input file",\r
+    "  -o OutputFile   Specifies the output file",\r
+    "  -s SectionType  Specifies the type of the section, which can be one of",\r
+    NULL\r
+  };\r
+\r
+  for (Index = 0; Str[Index] != NULL; Index++) {\r
+    fprintf (stdout, "%s\n", Str[Index]);\r
+  }\r
 \r
-  DisplayCount = 0;\r
   for (SectionType = 0; SectionType <= EFI_SECTION_LAST_SECTION_TYPE; SectionType++) {\r
     if (SectionTypeName[SectionType] != NULL) {\r
-      printf ("       %s\n", SectionTypeName[SectionType]);\r
+      fprintf (stdout, "                  %s\n", SectionTypeName[SectionType]);\r
     }\r
   }\r
-\r
-  printf ("\n    and SectionType dependent parameters are as follows:\n\n");\r
-  printf (\r
-    "       %s:       -t < %s | %s >\n",\r
+  fprintf (stdout, "Section dependent options:\n");\r
+  fprintf (stdout, \r
+    "  %s:       -t < %s | %s >\n",\r
     SectionTypeName[EFI_SECTION_COMPRESSION],\r
     CompressionTypeName[EFI_NOT_COMPRESSED],\r
     CompressionTypeName[EFI_STANDARD_COMPRESSION]\r
     );\r
-  printf (\r
-    "       %s:      -t < %s >\n""                          // Currently only CRC32 is supported\n\n",\r
+  fprintf (stdout,\r
+    "  %s:      -t < %s >  // Only CRC32 is supported\n",\r
     SectionTypeName[EFI_SECTION_GUID_DEFINED],\r
     GUIDedSectionTypeName[EFI_SECTION_CRC32_GUID_DEFINED]\r
     );\r
   printf (\r
-    "       %s:           -v VersionNumber\n""                          [-a \"Version string\"]\n\n",\r
+    "  %s:           -v VersionNumber [-a \"Version string\"]\n",\r
     SectionTypeName[EFI_SECTION_VERSION]\r
     );\r
   printf (\r
-    "       %s:    -a \"Human readable name\"\n\n",\r
+    "  %s:    -a \"Human readable name\"\n",\r
     SectionTypeName[EFI_SECTION_USER_INTERFACE]\r
     );\r
 }\r