]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Modified utility usage and version display.
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jan 2007 21:00:22 +0000 (21:00 +0000)
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jan 2007 21:00:22 +0000 (21:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2210 6f19259b-4bc3-4df7-8a09-765794883524

Tools/CCode/Source/SecFixup/SecFixup.c
Tools/CCode/Source/SecFixup/SecFixup.h

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
index 3694b1516a378f9fc2165559580bde3361c5b5e3..9d26656c5f74f7b64941935db2166bb78b98f312 100644 (file)
@@ -47,7 +47,7 @@ Abstract:
 // The function that displays general utility information\r
 //\r
 VOID\r
-PrintUtilityInfo (\r
+Version (\r
   VOID\r
   )\r
 /*++\r
@@ -71,7 +71,7 @@ Returns:
 // The function that displays the utility usage message.\r
 //\r
 VOID\r
-PrintUsage (\r
+Usage (\r
   VOID\r
   )\r
 /*++\r