]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Modified utility usage and version display.
authorywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jan 2007 21:08:01 +0000 (21:08 +0000)
committerywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Jan 2007 21:08:01 +0000 (21:08 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2211 6f19259b-4bc3-4df7-8a09-765794883524

Tools/CCode/Source/SetStamp/SetStamp.c

index 539aced1d977223bd2857a130a91d3e3add65050..51f5155ab885271e15d414907b7866e214ba9289 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \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
@@ -23,8 +23,43 @@ Abstract:
 \r
 #define LINE_MAXLEN 80\r
 \r
+//\r
+// Utility Name\r
+//\r
+#define UTILITY_NAME  "SetStamp"\r
+\r
+//\r
+// Utility version information\r
+//\r
+#define UTILITY_MAJOR_VERSION 0\r
+#define UTILITY_MINOR_VERSION 1\r
+\r
+void\r
+Version (\r
+  void\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
+{\r
+  printf ("%s v%d.%d -Utility to set Date/Time Stamp for Portable Executable (PE) format file.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
 void\r
-PrintUsage (\r
+Usage (\r
   void\r
   )\r
 /*++\r
@@ -38,10 +73,12 @@ Returns:
   None\r
 --*/\r
 {\r
+  Version();\r
+  \r
   //\r
   // print usage of command\r
   //\r
-  printf ("Usage: SetStamp <PE-File> <TIME-File>\n");\r
+  printf ("\nUsage: SetStamp <PE-File> <TIME-File>\n");\r
 }\r
 \r
 int\r
@@ -422,11 +459,26 @@ main (
   FILE    *fp;\r
   time_t  ltime;\r
 \r
+  if (argc == 1) {\r
+    Usage();\r
+    return -1;\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 -1;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+    Version();\r
+    return -1;\r
+  }\r
   //\r
   // check the number of parameters\r
   //\r
   if (argc != 3) {\r
-    PrintUsage ();\r
+    Usage ();\r
     return -1;\r
   }\r
   //\r