X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FCCode%2FSource%2FGenDepex%2FGenDepex.c;h=b010102e260c99b3735d7bf74157e3e5f2b3bf34;hp=3818649330555051e951ae5883c11833d6b76d13;hb=a85cb24e2bb75a9ad063db978d1f91ae036850ca;hpb=6dbea97890c3ad7cb82d8c8ae837f161560b4eee diff --git a/Tools/CCode/Source/GenDepex/GenDepex.c b/Tools/CCode/Source/GenDepex/GenDepex.c index 3818649330..b010102e26 100644 --- a/Tools/CCode/Source/GenDepex/GenDepex.c +++ b/Tools/CCode/Source/GenDepex/GenDepex.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2004, Intel Corporation +Copyright (c) 2004-2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -86,7 +86,7 @@ ParseDepex ( ); VOID -PrintGenDepexUtilityInfo ( +GDVersion ( VOID ) /*++ @@ -111,11 +111,11 @@ Returns: UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION ); - printf ("Copyright (C) 1996-2002 Intel Corporation. All rights reserved.\n\n"); + printf ("Copyright (C) 1996-2006 Intel Corporation. All rights reserved.\n"); } VOID -PrintGenDepexUsageInfo ( +GDUsage ( VOID ) /*++ @@ -134,15 +134,16 @@ Returns: --*/ { + GDVersion(); printf ( - "Usage: %s -I -O [-P ] \n", + "\n Usage: %s -I InputFile -O OutputFile [-P ] \n", UTILITY_NAME ); - printf (" Where:\n"); - printf (" is the input pre-processed dependency text files name.\n"); - printf (" is the output binary dependency files name.\n"); - printf (" is the padding integer value.\n"); - printf (" This is the boundary to align the output file size to.\n"); + printf (" Where:\n"); + printf (" InputFile is the input pre-processed dependency text files name.\n"); + printf (" OutputFile is the output binary dependency files name.\n"); + printf (" is the padding integer value.\n"); + printf (" This is the boundary to align the output file size to.\n"); } DEPENDENCY_OPCODE @@ -855,9 +856,25 @@ Returns: Output_Flag = FALSE; Pad_Flag = FALSE; + if (argc < 1) { + GDUsage(); + return -1; + } + + if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) || + (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) { + GDUsage(); + return 0; + } + + if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) { + GDVersion(); + return 0; + } + if (argc < 5) { printf ("Not enough arguments\n"); - PrintGenDepexUsageInfo (); + GDUsage(); return EFI_INVALID_PARAMETER; } @@ -901,17 +918,15 @@ Returns: } } - PrintGenDepexUtilityInfo (); - if (InFile == NULL) { printf ("Can not open for reading.\n"); - PrintGenDepexUsageInfo (); + GDUsage(); return EFI_ABORTED; } if (OutFile == NULL) { printf ("Can not open for writting.\n"); - PrintGenDepexUsageInfo (); + GDUsage(); return EFI_ABORTED; }