diff options
author | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-02 20:17:36 +0000 |
---|---|---|
committer | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-02 20:17:36 +0000 |
commit | f091efb3cb895692a55c310c368943bb4c108ba1 (patch) | |
tree | 51e140f919c4a6c0f6172549038b6c4cbdd24087 /Tools/CCode/Source/GenAcpiTable | |
parent | a3ab2a47d9ecb2295802726fd17f048c14519aab (diff) | |
download | edk2-platforms-f091efb3cb895692a55c310c368943bb4c108ba1.tar.xz |
Added or modified utility version and usage display.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2159 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/GenAcpiTable')
-rw-r--r-- | Tools/CCode/Source/GenAcpiTable/GenAcpiTable.c | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/Tools/CCode/Source/GenAcpiTable/GenAcpiTable.c b/Tools/CCode/Source/GenAcpiTable/GenAcpiTable.c index f1efa3c302..457ac65fef 100644 --- a/Tools/CCode/Source/GenAcpiTable/GenAcpiTable.c +++ b/Tools/CCode/Source/GenAcpiTable/GenAcpiTable.c @@ -32,8 +32,9 @@ Abstract: //
// Version of this utility
//
-#define UTILITY_NAME "GenAcpiTable"
-#define UTILITY_VERSION "v0.11"
+#define UTILITY_NAME "GenAcpiTable"
+#define UTILITY_MAJOR_VERSION 0
+#define UTILITY_MINOR_VERSION 11
//
// Define the max length of a filename
@@ -83,6 +84,12 @@ static STRING_LOOKUP mSubsystemTypes[] = { //
static
void
+Version (
+ VOID
+ );
+
+static
+void
Usage (
VOID
);
@@ -489,6 +496,22 @@ Returns: Argc--;
Argv++;
+ if (Argc < 1) {
+ 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;
+ }
+
if (Argc != 2) {
Usage ();
return STATUS_ERROR;
@@ -508,6 +531,17 @@ Returns: static
void
+Version (
+ VOID
+ )
+{
+ printf ("%s v%d.%d -EDK Utility for generating ACPI Table image from an EFI PE32 image.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
+ printf ("Copyright (c) 1999-2006 Intel Corporation. All rights reserved.\n");
+}
+
+
+static
+void
Usage (
VOID
)
@@ -529,15 +563,14 @@ Returns: {
int Index;
static const char *Msg[] = {
- UTILITY_NAME " version "UTILITY_VERSION " - Generate ACPI Table image utility",
- " Generate an ACPI Table image from an EFI PE32 image",
- " Usage: "UTILITY_NAME " InFileName OutFileName",
- " where:",
- " InFileName - name of the input PE32 file",
- " OutFileName - to write output to OutFileName rather than InFileName"DEFAULT_OUTPUT_EXTENSION,
- "",
+ "\nUsage: "UTILITY_NAME " {-h|--help|-?|/?|-V|--version} InFileName OutFileName",
+ " where:",
+ " InFileName - name of the input PE32 file",
+ " OutFileName - to write output to OutFileName rather than InFileName"DEFAULT_OUTPUT_EXTENSION,
NULL
};
+
+ Version();
for (Index = 0; Msg[Index] != NULL; Index++) {
fprintf (stdout, "%s\n", Msg[Index]);
}
|