[Expat-checkins] CVS: expat/xmlwf xmlwf.c,1.55,1.56

Fred L. Drake fdrake@users.sourceforge.net
Wed Dec 5 08:31:08 2001


Update of /cvsroot/expat/expat/xmlwf
In directory usw-pr-cvs1:/tmp/cvs-serv15363

Modified Files:
	xmlwf.c 
Log Message:
Add a -v option to cause xmlwf to report the version of Expat (hence the
version of xmlwf).


Index: xmlwf.c
===================================================================
RCS file: /cvsroot/expat/expat/xmlwf/xmlwf.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** xmlwf.c	2000/09/28 19:47:35	1.55
--- xmlwf.c	2001/12/05 16:30:31	1.56
***************
*** 562,565 ****
--- 562,578 ----
  
  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)
  {
***************
*** 655,658 ****
--- 668,674 ----
        j = 0;
        break;
+     case T('v'):
+       showVersion(argv[0]);
+       return 0;
      case T('\0'):
        if (j > 1) {