Modified utility usage and version display.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2210 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ywang 2007-01-10 21:00:22 +00:00
parent fd23b925fb
commit eaad41e892
2 changed files with 29 additions and 20 deletions

View File

@ -36,7 +36,7 @@ Abstract:
#include "SecFixup.h" #include "SecFixup.h"
VOID VOID
PrintUtilityInfo ( Version (
VOID VOID
) )
/*++ /*++
@ -55,16 +55,12 @@ Returns:
--*/ --*/
{ {
printf ( printf ("%s v%d.%d -Tiano IA32 SEC Fixup Utility.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
"%s - Tiano IA32 SEC Fixup Utility."" Version %i.%i\n\n", printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
UTILITY_NAME,
UTILITY_MAJOR_VERSION,
UTILITY_MINOR_VERSION
);
} }
VOID VOID
PrintUsage ( Usage (
VOID VOID
) )
/*++ /*++
@ -83,11 +79,13 @@ Returns:
--*/ --*/
{ {
printf ("Usage: %s SecExeFile ResetVectorDataFile OutputFile\n", UTILITY_NAME); Version();
printf ("\nUsage: %s SecExeFile ResetVectorDataFile OutputFile\n", UTILITY_NAME);
printf (" Where:\n"); printf (" Where:\n");
printf ("\tSecExeFile - Name of the IA32 SEC EXE file.\n"); printf (" SecExeFile - Name of the IA32 SEC EXE file.\n");
printf ("\tResetVectorDataFile - Name of the reset vector data binary file.\n"); printf (" ResetVectorDataFile - Name of the reset vector data binary file.\n");
printf ("\tOutputFileName - Name of the output file.\n\n"); printf (" OutputFileName - Name of the output file.\n");
} }
STATUS STATUS
@ -122,17 +120,28 @@ Returns:
SetUtilityName (UTILITY_NAME); SetUtilityName (UTILITY_NAME);
// if (argc == 1) {
// Display utility information Usage();
// return STATUS_ERROR;
PrintUtilityInfo (); }
if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||
(strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {
Usage();
return STATUS_ERROR;
}
if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {
Version();
return STATUS_ERROR;
}
// //
// Verify the correct number of arguments // Verify the correct number of arguments
// //
if (argc != MAX_ARGS) { if (argc != MAX_ARGS) {
Error (NULL, 0, 0, "invalid number of input parameters specified", NULL); Error (NULL, 0, 0, "invalid number of input parameters specified", NULL);
PrintUsage (); Usage ();
return STATUS_ERROR; return STATUS_ERROR;
} }
// //

View File

@ -47,7 +47,7 @@ Abstract:
// The function that displays general utility information // The function that displays general utility information
// //
VOID VOID
PrintUtilityInfo ( Version (
VOID VOID
) )
/*++ /*++
@ -71,7 +71,7 @@ Returns:
// The function that displays the utility usage message. // The function that displays the utility usage message.
// //
VOID VOID
PrintUsage ( Usage (
VOID VOID
) )
/*++ /*++