]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/GenDepex/GenDepex.c
Renaming files/directories
[mirror_edk2.git] / Tools / CCode / Source / GenDepex / GenDepex.c
index 3818649330555051e951ae5883c11833d6b76d13..5c27797a9be9aa3fd2265eedc52148a829c4ab30 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation                                                         \r
+Copyright (c) 2004-2006, 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
@@ -86,7 +86,7 @@ ParseDepex (
   );\r
 \r
 VOID\r
-PrintGenDepexUtilityInfo (\r
+Version (\r
   VOID\r
   )\r
 /*++\r
@@ -106,16 +106,16 @@ Returns:
 --*/\r
 {\r
   printf (\r
-    "%s, Tiano Dependency Expression Generation Utility. Version %d.%d.\n",\r
+    "%s v%d.%d -Tiano utility to generate dependency expression.\n",\r
     UTILITY_NAME,\r
     UTILITY_MAJOR_VERSION,\r
     UTILITY_MINOR_VERSION\r
     );\r
-  printf ("Copyright (C) 1996-2002 Intel Corporation.  All rights reserved.\n\n");\r
+  printf ("Copyright (C) 1996-2006 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
 VOID\r
-PrintGenDepexUsageInfo (\r
+Usage (\r
   VOID\r
   )\r
 /*++\r
@@ -134,15 +134,16 @@ Returns:
 \r
 --*/\r
 {\r
+  Version();\r
   printf (\r
-    "Usage: %s -I <INFILE> -O <OUTFILE> [-P <Optional Boundary for padding up>] \n",\r
+    "\nUsage: %s -I InputFile -O OutputFile [-P <Optional Boundary for padding up>] \n",\r
     UTILITY_NAME\r
     );\r
-  printf (" Where:\n");\r
-  printf ("  <INFILE> is the input pre-processed dependency text files name.\n");\r
-  printf ("  <OUTFILE> is the output binary dependency files name.\n");\r
-  printf ("  <Optional Boundary for padding up> is the padding integer value.\n");\r
-  printf ("    This is the boundary to align the output file size to.\n");\r
+  printf ("  Where:\n");\r
+  printf ("    InputFile is the input pre-processed dependency text files name.\n");\r
+  printf ("    OutputFile is the output binary dependency files name.\n");\r
+  printf ("    <Optional Boundary for padding up> is the padding integer value.\n");\r
+  printf ("       This is the boundary to align the output file size to.\n");\r
 }\r
 \r
 DEPENDENCY_OPCODE\r
@@ -838,7 +839,6 @@ Returns:
   EFI_ABORTED             Unable to open/create a file or a misc error.\r
 \r
 --*/\r
-// TODO:    ] - add argument and description to function comment\r
 {\r
   FILE    *OutFile;\r
   FILE    *InFile;\r
@@ -855,9 +855,25 @@ Returns:
   Output_Flag = FALSE;\r
   Pad_Flag    = FALSE;\r
 \r
+  if (argc == 1) {\r
+    Usage();\r
+    return EFI_INVALID_PARAMETER;\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 EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+    Version();\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
\r
   if (argc < 5) {\r
     printf ("Not enough arguments\n");\r
-    PrintGenDepexUsageInfo ();\r
+    Usage();\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -901,17 +917,15 @@ Returns:
     }\r
   }\r
 \r
-  PrintGenDepexUtilityInfo ();\r
-\r
   if (InFile == NULL) {\r
     printf ("Can not open <INFILE> for reading.\n");\r
-    PrintGenDepexUsageInfo ();\r
+    Usage();\r
     return EFI_ABORTED;\r
   }\r
 \r
   if (OutFile == NULL) {\r
     printf ("Can not open <OUTFILE> for writting.\n");\r
-    PrintGenDepexUsageInfo ();\r
+    Usage();\r
     return EFI_ABORTED;\r
   }\r
 \r