From 5ca5c566a6b22143ec8651d650557fb75ee43d2d Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Wed, 5 Dec 2001 16:30:31 +0000 Subject: [PATCH] Add a -v option to cause xmlwf to report the version of Expat (hence the version of xmlwf). --- expat/xmlwf/xmlwf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index 891c0db5..27cb12cb 100755 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -560,6 +560,19 @@ int notStandalone(void *userData) return 0; } +static +void showVersion(XML_Char *prog) +{ + XML_Char *s = prog; + XML_Char ch; + while ((ch = *s) != 0) { + if (ch == '/' || ch == '\\') + prog = s + 1; + ++s; + } + ftprintf(stdout, T("%s using %s\n"), prog, XML_ExpatVersion()); +} + static void usage(const XML_Char *prog) { @@ -654,6 +667,9 @@ int tmain(int argc, XML_Char **argv) i++; j = 0; break; + case T('v'): + showVersion(argv[0]); + return 0; case T('\0'): if (j > 1) { i++;