git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2162
6f19259b-4bc3-4df7-8a09-
765794883524
//\r
if (argc < 1) {\r
Usage();\r
//\r
if (argc < 1) {\r
Usage();\r
}\r
\r
if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
(strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
Usage();\r
}\r
\r
if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
(strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
Usage();\r
}\r
\r
if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
Version();\r
}\r
\r
if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
Version();\r
}\r
\r
if (argc != ONE_BSF_ARGS && argc != TWO_BSF_ARGS) {\r
}\r
\r
if (argc != ONE_BSF_ARGS && argc != TWO_BSF_ARGS) {\r
-Copyright (c) 2004, Intel Corporation \r
+Copyright (c) 2004-2007, Intel Corporation \r
All rights reserved. This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
All rights reserved. This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
\r
#include "GenCRC32Section.h"\r
\r
\r
#include "GenCRC32Section.h"\r
\r
-#define TOOLVERSION "0.2"\r
-\r
-#define UTILITY_NAME "GenCrc32Section"\r
+#define UTILITY_NAME "GenCrc32Section"\r
+#define UTILITY_MAJOR_VERSION 0\r
+#define UTILITY_MINOR_VERSION 2\r
\r
EFI_GUID gEfiCrc32SectionGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
\r
\r
EFI_GUID gEfiCrc32SectionGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Displays the standard utility information to SDTOUT\r
+\r
+Arguments:\r
+\r
+ None\r
+\r
+Returns:\r
+\r
+ None\r
+\r
+--*/\r
- printf ("Usage:\n");\r
- printf (UTILITY_NAME " -i \"inputfile1\" \"inputfile2\" -o \"outputfile\" \n");\r
- printf (" -i \"inputfile\":\n ");\r
- printf (" specifies the input files that would be signed to CRC32 Guided section.\n");\r
- printf (" -o \"outputfile\":\n");\r
- printf (" specifies the output file that is a CRC32 Guided section.\n");\r
+ printf (\r
+ "%s v%d.%d -Utility for generating Firmware File System files.\n",\r
+ UTILITY_NAME,\r
+ UTILITY_MAJOR_VERSION,\r
+ UTILITY_MINOR_VERSION\r
+ );\r
+}\r
+\r
+\r
+VOID\r
+Usage (\r
+ VOID\r
+ )\r
+{\r
+ Version();\r
+ \r
+ printf ("\nUsage:\n");\r
+ printf (UTILITY_NAME " -i Inputfile1 Inputfile2 -o Outputfile\n");\r
+ printf (" -i Inputfile: specifies the input files signed to CRC32 Guided section.\n");\r
+ printf (" -o Outputfile: specifies the output file that is a CRC32 Guided section.\n");\r
\r
SetUtilityName (UTILITY_NAME);\r
\r
\r
SetUtilityName (UTILITY_NAME);\r
\r
+ if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+ (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+ Usage();\r
+ return -1;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+ Version();\r
+ return -1;\r
+ }\r
+ \r
#include "EfiUtilityMsgs.h"\r
\r
#define MAX_PATH 256\r
#include "EfiUtilityMsgs.h"\r
\r
#define MAX_PATH 256\r
-#define PROGRAM_NAME "GenCapsuleHdr"\r
+\r
+#define UTILITY_NAME "GenCapsuleHdr"\r
+#define UTILITY_MAJOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 0\r
\r
#define UNICODE_BACKSLASH L'\\'\r
#define UNICODE_FILE_START 0xFEFF\r
\r
#define UNICODE_BACKSLASH L'\\'\r
#define UNICODE_FILE_START 0xFEFF\r
INT8 *CapsuleFileName\r
);\r
\r
INT8 *CapsuleFileName\r
);\r
\r
+static\r
+void\r
+Version (\r
+ VOID\r
+ );\r
+\r
static\r
void\r
Usage (\r
static\r
void\r
Usage (\r
//\r
// Specify our program name to the error printing routines.\r
//\r
//\r
// Specify our program name to the error printing routines.\r
//\r
- SetUtilityName (PROGRAM_NAME);\r
+ SetUtilityName (UTILITY_NAME);\r
//\r
// Process the command-line arguments\r
//\r
//\r
// Process the command-line arguments\r
//\r
Usage ();\r
return STATUS_ERROR;\r
}\r
Usage ();\r
return STATUS_ERROR;\r
}\r
+ \r
+ if ((strcmp(Argv[0], "-h") == 0) || (strcmp(Argv[0], "--help") == 0) ||\r
+ (strcmp(Argv[0], "-?") == 0) || (strcmp(Argv[0], "/?") == 0)) {\r
+ Usage();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(Argv[0], "-V") == 0) || (strcmp(Argv[0], "--version") == 0)) {\r
+ Version();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
//\r
// Process until no more options\r
//\r
//\r
// Process until no more options\r
//\r
return STATUS_SUCCESS;\r
}\r
\r
return STATUS_SUCCESS;\r
}\r
\r
+static\r
+void \r
+Version(\r
+ void\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Print out version information for this utility.\r
+\r
+Arguments:\r
+\r
+ None\r
+ \r
+Returns:\r
+\r
+ None\r
+ \r
+--*/ \r
+{\r
+ printf ("%s v%d.%d -EDK utility to create a capsule header.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2006 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
static\r
void\r
Usage (\r
static\r
void\r
Usage (\r
{\r
int Index;\r
static const char *Str[] = {\r
{\r
int Index;\r
static const char *Str[] = {\r
- PROGRAM_NAME " -- create a capsule header",\r
- " Usage: "PROGRAM_NAME " {options} [CapsuleFV]",\r
+ "\nUsage: "UTILITY_NAME " {options} [CapsuleFV]",\r
//\r
// {FfsFileNames}",\r
//\r
" Options include:",\r
//\r
// {FfsFileNames}",\r
//\r
" Options include:",\r
- " -h or -? for this help information",\r
+ " -h,--help,-?,/? to display help messages",\r
+ " -V,--version to display version information",\r
" -script fname to take capsule header info from unicode script",\r
" file fname",\r
" -o fname write output to file fname (required)",\r
" -script fname to take capsule header info from unicode script",\r
" file fname",\r
" -o fname write output to file fname (required)",\r
for (Index = 0; Str[Index] != NULL; Index++) {\r
fprintf (stdout, "%s\n", Str[Index]);\r
}\r
for (Index = 0; Str[Index] != NULL; Index++) {\r
fprintf (stdout, "%s\n", Str[Index]);\r
}\r
- printf ("%s v%d.%d -EDK Convert EXE to BIN\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("%s v%d.%d -EDK Utility to Convert EXE to BIN\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");\r
}\r
\r
printf ("Copyright (c) 2005-2006 Intel Corporation. All rights reserved.\n");\r
}\r
\r