]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/SecFixup/SecFixup.c
Fix the unalignment issue for RODATA section when converting ELF image to PE image.
[mirror_edk2.git] / Tools / CCode / Source / SecFixup / SecFixup.c
index c2d46a1d5cb9cd3d74463f13d345ea34da54a355..5a36cdff5e44e73a7b517cd37319a7651a2d46d8 100644 (file)
@@ -36,7 +36,7 @@ Abstract:
 #include "SecFixup.h"\r
 \r
 VOID\r
-PrintUtilityInfo (\r
+Version (\r
   VOID\r
   )\r
 /*++\r
@@ -55,16 +55,12 @@ Returns:
 \r
 --*/\r
 {\r
-  printf (\r
-    "%s - Tiano IA32 SEC 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 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
@@ -83,11 +79,13 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("Usage: %s SecExeFile ResetVectorDataFile OutputFile\n", UTILITY_NAME);\r
+  Version();\r
+  \r
+  printf ("\nUsage: %s SecExeFile ResetVectorDataFile OutputFile\n", UTILITY_NAME);\r
   printf ("  Where:\n");\r
-  printf ("\tSecExeFile           - Name of the IA32 SEC EXE file.\n");\r
-  printf ("\tResetVectorDataFile  - Name of the reset vector data binary file.\n");\r
-  printf ("\tOutputFileName       - Name of the output file.\n\n");\r
+  printf ("     SecExeFile           - Name of the IA32 SEC EXE file.\n");\r
+  printf ("     ResetVectorDataFile  - Name of the reset vector data binary file.\n");\r
+  printf ("     OutputFileName       - Name of the output file.\n");\r
 }\r
 \r
 STATUS\r
@@ -122,17 +120,28 @@ Returns:
 \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