diff options
author | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-08 22:27:20 +0000 |
---|---|---|
committer | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-08 22:27:20 +0000 |
commit | db608e6b5b00f54a678d7144170ccb5057782e14 (patch) | |
tree | d9633061545281358354db4f3338a69acfe94dd0 /Tools/CCode/Source/GenTEImage | |
parent | 66d8c20686febc5f7ba580dd79377c93435b75ad (diff) | |
download | edk2-platforms-db608e6b5b00f54a678d7144170ccb5057782e14.tar.xz |
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/GenTEImage')
-rw-r--r-- | Tools/CCode/Source/GenTEImage/GenTEImage.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/Tools/CCode/Source/GenTEImage/GenTEImage.c b/Tools/CCode/Source/GenTEImage/GenTEImage.c index 90f3b3919a..39b83326e2 100644 --- a/Tools/CCode/Source/GenTEImage/GenTEImage.c +++ b/Tools/CCode/Source/GenTEImage/GenTEImage.c @@ -34,7 +34,8 @@ Abstract: // Version of this utility
//
#define UTILITY_NAME "GenTEImage"
-#define UTILITY_VERSION "v0.11"
+#define UTILITY_MAJOR_VERSION 0
+#define UTILITY_MINOR_VERSION 11
//
// Define the max length of a filename
@@ -86,6 +87,12 @@ static STRING_LOOKUP mSubsystemTypes[] = { //
static
void
+Version (
+ VOID
+ );
+
+static
+void
Usage (
VOID
);
@@ -669,6 +676,18 @@ Returns: Usage ();
return STATUS_ERROR;
}
+
+ if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||
+ (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {
+ Usage();
+ return STATUS_ERROR;
+ }
+
+ if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {
+ Version();
+ return STATUS_ERROR;
+ }
+
//
// Process until no more arguments
//
@@ -734,6 +753,31 @@ Returns: }
static
+void
+Version(
+ void
+)
+/*++
+
+Routine Description:
+
+ Displays the standard utility information to SDTOUT
+
+Arguments:
+
+ None
+
+Returns:
+
+ None
+
+--*/
+{
+ printf ("%s v%d.%d -Utility to generate a TE image from an EFI PE32 image.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
+ printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");
+}
+
+static
void
Usage (
VOID
@@ -756,19 +800,21 @@ Returns: {
int Index;
static const char *Msg[] = {
- UTILITY_NAME " version "UTILITY_VERSION " - TE image utility",
- " Generate a TE image from an EFI PE32 image",
- " Usage: "UTILITY_NAME " {-v} {-dump} {-h|-?} {-o OutFileName} InFileName",
+ "\nUsage: "UTILITY_NAME " {-v} {-dump} {-h|-?} {-o OutFileName} InFileName",
" [-e|-b] [FileName(s)]",
" where:",
+ " -h,--help,-?,/? to display help messages",
+ " -V,--version to display version information",
" -v - for verbose output",
" -dump - to dump the input file to a text file",
- " -h -? - for this help information",
" -o OutFileName - to write output to OutFileName rather than InFileName"DEFAULT_OUTPUT_EXTENSION,
" InFileName - name of the input PE32 file",
"",
NULL
};
+
+ Version();
+
for (Index = 0; Msg[Index] != NULL; Index++) {
fprintf (stdout, "%s\n", Msg[Index]);
}
|