diff options
author | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-14 22:01:45 +0000 |
---|---|---|
committer | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-14 22:01:45 +0000 |
commit | a85cb24e2bb75a9ad063db978d1f91ae036850ca (patch) | |
tree | 1ec05c73dcac40dc9fb80d6300cd300aef4c4a0e /Tools/CCode/Source/EfiCompress/EfiCompressMain.c | |
parent | 6dbea97890c3ad7cb82d8c8ae837f161560b4eee (diff) | |
download | edk2-platforms-a85cb24e2bb75a9ad063db978d1f91ae036850ca.tar.xz |
File modified to add usage information and implement minor corrections.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1954 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/EfiCompress/EfiCompressMain.c')
-rw-r--r-- | Tools/CCode/Source/EfiCompress/EfiCompressMain.c | 81 |
1 files changed, 71 insertions, 10 deletions
diff --git a/Tools/CCode/Source/EfiCompress/EfiCompressMain.c b/Tools/CCode/Source/EfiCompress/EfiCompressMain.c index 492210f67c..f745ea2b46 100644 --- a/Tools/CCode/Source/EfiCompress/EfiCompressMain.c +++ b/Tools/CCode/Source/EfiCompress/EfiCompressMain.c @@ -27,9 +27,61 @@ Abstract: #include <stdio.h>
#include <Common/UefiBaseTypes.h>
-
#include "EfiCompress.h"
+#define UTILITY_NAME "EfiCompress"
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 1
+
+void
+ECVersion(
+ void
+ )
+/*++
+
+Routine Description:
+
+ Print out version information for EfiCompress.
+
+Arguments:
+
+ None
+
+Returns:
+
+ None
+
+--*/
+{
+ printf ("%s v%d.%d -EDK Efi Compress Utility\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);
+ printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");
+}
+
+void
+ECUsage(
+ void
+ )
+/*++
+
+Routine Description:
+
+ Print out usage information for EfiCompress.
+
+Arguments:
+
+ None
+
+Returns:
+
+ None
+
+--*/
+{
+ ECVersion();
+ printf ("\n Usage: %s Inputfile Outputfile\n", UTILITY_NAME);
+}
+
+
int
main (
INT32 argc,
@@ -65,19 +117,28 @@ Returns: // Added for makefile debug - KCE
//
INT32 arg_counter;
- printf ("\n\n");
- for (arg_counter = 0; arg_counter < argc; arg_counter++) {
- printf ("%s ", argv[arg_counter]);
- }
-
- printf ("\n\n");
-
+
SrcBuffer = DstBuffer = NULL;
-
infile = outfile = NULL;
+ if (argc < 1) {
+ ECUsage();
+ goto Done;
+ }
+
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {
+ ECUsage();
+ goto Done;
+ }
+
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {
+ ECVersion();
+ goto Done;
+ }
+
if (argc != 3) {
- printf ("Usage: EFICOMPRESS <infile> <outfile>\n");
+ ECUsage();
goto Done;
}
|