diff options
author | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-17 21:31:03 +0000 |
---|---|---|
committer | ywang <ywang@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-17 21:31:03 +0000 |
commit | 243009a7bf0cbd4a40815343d132481031f128c2 (patch) | |
tree | 5ac02172c1b319404d72ce95559b2f0bee61f3f0 /Tools/CCode/Source/SplitFile | |
parent | 92bb9cf6370df8e6685111f85429afa2a576008d (diff) | |
download | edk2-platforms-243009a7bf0cbd4a40815343d132481031f128c2.tar.xz |
Modified version and usage display.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2262 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/SplitFile')
-rw-r--r-- | Tools/CCode/Source/SplitFile/SplitFile.c | 68 |
1 files changed, 61 insertions, 7 deletions
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 <Filename>1 and <Filename>2 with \n\
+ <Filename> 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;
}
|