]> granicus.if.org Git - libexpat/commitdiff
Add a -v option to cause xmlwf to report the version of Expat (hence the
authorFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Wed, 5 Dec 2001 16:30:31 +0000 (16:30 +0000)
committerFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Wed, 5 Dec 2001 16:30:31 +0000 (16:30 +0000)
version of xmlwf).

expat/xmlwf/xmlwf.c

index 891c0db5f3d80ab2e67599b0effb3e431969cb11..27cb12cbdaccabd56b449016f20da7c4a8a68a02 100755 (executable)
@@ -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++;