#include "CommonLib.h"\r
#include "EfiUtilityMsgs.c"\r
\r
-#define UTILITY_NAME "FwImage"\r
+//\r
+// Version of this utility\r
+//\r
+#define UTILITY_NAME "FwImage"\r
+#define UTILITY_MAJOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 0\r
\r
#ifdef __GNUC__\r
typedef unsigned long ULONG;\r
typedef unsigned short USHORT;\r
#endif\r
\r
+static\r
+void\r
+Version (\r
+ VOID\r
+ )\r
+{\r
+ printf ("%s v%d.%d -EDK Utility for Converting a pe32+ image to an FW image type.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+ printf ("Copyright (c) 1999-2006 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
+\r
VOID\r
Usage (\r
VOID\r
)\r
{\r
- printf ("Usage: " UTILITY_NAME " {-t time-date} [BASE|SEC|PEI_CORE|PEIM|DXE_CORE|DXE_DRIVER|DXE_RUNTIME_DRIVER|DXE_SAL_DRIVER|DXE_SMM_DRIVER|TOOL|UEFI_DRIVER|UEFI_APPLICATION|USER_DEFINED] peimage [outimage]");\r
+ Version();\r
+ printf ("\nUsage: " UTILITY_NAME " {-t time-date} {-h|--help|-?|/?|-V|--version} \n\\r
+ [BASE|SEC|PEI_CORE|PEIM|DXE_CORE|DXE_DRIVER|DXE_RUNTIME_DRIVER|\n\\r
+ DXE_SAL_DRIVER|DXE_SMM_DRIVER|TOOL|UEFI_DRIVER|UEFI_APPLICATION|\n\\r
+ USER_DEFINED] peimage [outimage]");\r
}\r
\r
static\r
TimeStamp = 0;\r
TimeStampPresent = FALSE;\r
\r
+ if (argc < 1) {\r
+ Usage();\r
+ return STATUS_ERROR;\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
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+ Version();\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
//\r
// Look for -t time-date option first. If the time is "0", then\r
// skip it.\r