From 773b54cdf97a9cbad83d309c0d99f157a7b0d27e Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 8 Jun 2005 16:23:14 +0000 Subject: RTFX now displays version number with -v argument. --- src/rtfx.1 | 8 ++++++-- src/rtfx.cpp | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rtfx.1 b/src/rtfx.1 index 3d234c6..7b742c6 100644 --- a/src/rtfx.1 +++ b/src/rtfx.1 @@ -45,6 +45,8 @@ .Op Fl pw .Op Ar inrtf .Op Ar outxml +.Nm +.Fl v .Sh DESCRIPTION .Nm converts RTF files into a generic XML format. It majors on keeping meta data like style @@ -62,6 +64,10 @@ The options are as follows: Puts .Nm into 'presentation' output mode. +.It Fl v +Displays +.Nm +version number and then quits. .It Fl w Output XML is written with indents for easy reading. .It Ar inrtf @@ -71,7 +77,5 @@ The XML file to output the converted data to. If not specified writes to stdout. .El .Sh WEBSITE http://memberwebs.com/nielsen/software/rtfx/ -.Sh BUGS -Doesn't handle crummy RTF files nicely. Needs some speed improvements. .Sh AUTHOR .An Nate Nielsen Aq nielsen@memberwebs.com diff --git a/src/rtfx.cpp b/src/rtfx.cpp index e305959..5428148 100644 --- a/src/rtfx.cpp +++ b/src/rtfx.cpp @@ -44,15 +44,17 @@ #include "rtfparser.h" #include "xmlcomposer.h" -int usage() +void usage() { fprintf(stderr, "usage: rtfx [-pw] [inrtf] [outxml]\n"); + fprintf(stderr, " rtfx -v\n"); exit(2); } int main(int argc, char* argv[]) { XmlComposerOptions options; + bool version = false; argc--; argv++; @@ -75,6 +77,10 @@ int main(int argc, char* argv[]) options.pretty = true; break; + case 'v': + version = true; + break; + case '-': arg = NULL; break; @@ -92,6 +98,12 @@ int main(int argc, char* argv[]) argv++; } + if(version) + { + fprintf(stdout, "RTFX (version %s)\n", VERSION); + return 0; + } + if(argc > 2) usage(); -- cgit v1.2.3