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
This commit is contained in:
ywang
2006-11-14 22:01:45 +00:00
parent 6dbea97890
commit a85cb24e2b
5 changed files with 326 additions and 73 deletions

View File

@ -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;
}