From 243009a7bf0cbd4a40815343d132481031f128c2 Mon Sep 17 00:00:00 2001 From: ywang Date: Wed, 17 Jan 2007 21:31:03 +0000 Subject: Modified version and usage display. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2262 6f19259b-4bc3-4df7-8a09-765794883524 --- Tools/CCode/Source/SplitFile/SplitFile.c | 68 ++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 7 deletions(-) (limited to 'Tools/CCode/Source/SplitFile') 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; } -- cgit v1.2.3