X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FCCode%2FSource%2FSplitFile%2FSplitFile.c;h=68a0739a5f628329cb44521b143fa583e923f442;hp=a1bda7dc312ea0bf21794797f17394ff3a6a4dc0;hb=243009a7bf0cbd4a40815343d132481031f128c2;hpb=92bb9cf6370df8e6685111f85429afa2a576008d diff --git a/Tools/CCode/Source/SplitFile/SplitFile.c b/Tools/CCode/Source/SplitFile/SplitFile.c index a1bda7dc31..68a0739a5f 100644 --- a/Tools/CCode/Source/SplitFile/SplitFile.c +++ b/Tools/CCode/Source/SplitFile/SplitFile.c @@ -16,8 +16,43 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "string.h" #include "stdlib.h" +// +// Utility Name +// +#define UTILITY_NAME "SplitFile" + +// +// Utility version information +// +#define UTILITY_MAJOR_VERSION 0 +#define UTILITY_MINOR_VERSION 1 + +void +Version ( + void + ) +/*++ + +Routine Description: + + Displays the standard utility information to SDTOUT + +Arguments: + + None + +Returns: + + None + +--*/ +{ + printf ("%s v%d.%d -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION); + printf ("Copyright (c) 1999-2007 Intel Corporation. All rights reserved.\n"); +} + void -helpmsg ( +Usage ( void ) /*++ @@ -35,11 +70,14 @@ Returns: --*/ { - printf ( - "SplitFile Filename Offset\n"" Filename = Input file to split\n"" Offset = offset at which to split file\n" - "\n\n""SplitFile will break a file in two pieces at the requested offset\n" - " outputting Filename1 and Filename2\n" - ); + Version(); + printf ("\nUsage: \n\ + SplitFile Filename Offset\n\ + where:\n\ + Filename: Input file to split\n\ + Offset: offset at which to split file\n\ + The output files will be named 1 and 2 with \n\ + being given as the input file name.\n"); } int @@ -75,8 +113,24 @@ Returns: unsigned long splitpoint; char CharC; + if (argc == 1) { + Usage(); + return -1; + } + + if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) || + (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) { + Usage(); + return -1; + } + + if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) { + Version(); + return -1; + } + if (argc != 3) { - helpmsg (); + Usage (); return -1; }