summaryrefslogtreecommitdiff
path: root/Tools/CCode/Source/GenFvImage
diff options
context:
space:
mode:
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-08 22:27:20 +0000
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-08 22:27:20 +0000
commitdb608e6b5b00f54a678d7144170ccb5057782e14 (patch)
treed9633061545281358354db4f3338a69acfe94dd0 /Tools/CCode/Source/GenFvImage
parent66d8c20686febc5f7ba580dd79377c93435b75ad (diff)
downloadedk2-db608e6b5b00f54a678d7144170ccb5057782e14.zip
edk2-db608e6b5b00f54a678d7144170ccb5057782e14.tar.gz
edk2-db608e6b5b00f54a678d7144170ccb5057782e14.tar.bz2
Minor changes and bug fixes implemented.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2196 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/GenFvImage')
-rw-r--r--Tools/CCode/Source/GenFvImage/GenFvImageExe.c65
1 files changed, 39 insertions, 26 deletions
diff --git a/Tools/CCode/Source/GenFvImage/GenFvImageExe.c b/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
index f5a5179..294c303 100644
--- a/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
+++ b/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation
+Copyright (c) 2004-2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -29,10 +29,11 @@ Abstract:
#include "CommonLib.h"
#include "EfiUtilityMsgs.h"
-VOID
-PrintUtilityInfo (
- VOID
- )
+static
+void
+Version(
+ void
+)
/*++
Routine Description:
@@ -49,17 +50,15 @@ Returns:
--*/
{
- printf (
- "%s - Tiano Firmware Volume Generation Utility."" Version %i.%i\n\n",
- UTILITY_NAME,
- UTILITY_MAJOR_VERSION,
- UTILITY_MINOR_VERSION
- );
+ printf ("%s v%d.%d -Tiano Firmware Volume Generation Utility.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
}
+
-VOID
-PrintUsage (
- VOID
+static
+void
+Usage(
+ void
)
/*++
@@ -77,9 +76,11 @@ Returns:
--*/
{
- printf ("Usage: %s -I FvInfFileName\n", UTILITY_NAME);
+ Version();
+
+ printf ("\nUsage: %s -I FvInfFileName\n", UTILITY_NAME);
printf (" Where:\n");
- printf ("\tFvInfFileName is the name of the image description file.\n\n");
+ printf (" FvInfFileName is the name of the image description file.\n\n");
}
int
@@ -133,17 +134,29 @@ Returns:
SymFileName = SymFileNameBuffer;
SetUtilityName (UTILITY_NAME);
- //
- // Display utility information
- //
- PrintUtilityInfo ();
-
+
+ if (argc == 1) {
+ Usage ();
+ return STATUS_ERROR;
+ }
+
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {
+ Usage();
+ return GetUtilityStatus ();
+ }
+
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {
+ Version();
+ return GetUtilityStatus ();
+ }
+
//
// Verify the correct number of arguments
//
if (argc != MAX_ARGS) {
Error (NULL, 0, 0, "invalid number of input parameters specified", NULL);
- PrintUsage ();
+ Usage ();
return GetUtilityStatus ();
}
//
@@ -160,7 +173,7 @@ Returns:
//
if (argv[Index][0] != '-' && argv[Index][0] != '/') {
Error (NULL, 0, 0, argv[Index], "argument pair must begin with \"-\" or \"/\"");
- PrintUsage ();
+ Usage ();
return GetUtilityStatus ();
}
//
@@ -168,7 +181,7 @@ Returns:
//
if (argv[Index][2] != 0) {
Error (NULL, 0, 0, argv[Index], "unrecognized argument");
- PrintUsage ();
+ Usage ();
return GetUtilityStatus ();
}
//
@@ -182,14 +195,14 @@ Returns:
strcpy (InfFileName, argv[Index + 1]);
} else {
Error (NULL, 0, 0, argv[Index + 1], "FvInfFileName may only be specified once");
- PrintUsage ();
+ Usage ();
return GetUtilityStatus ();
}
break;
default:
Error (NULL, 0, 0, argv[Index], "unrecognized argument");
- PrintUsage ();
+ Usage ();
return GetUtilityStatus ();
break;
}