deprecated -xml output.xml

use -o instead


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4379 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Klaus Wiederänders 2003-02-22 09:16:13 +00:00
commit 0a794f4b08

View file

@ -1,10 +1,10 @@
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Xml.cxx * Xml.cxx
* *
* A web-base parse tree Xml using SWILL. This is an optional * An Xml parse tree generator
* feature that's normally disabled.
* * Author(s) : Swig base: David Beazley (beazley@cs.uchicago.edu)
* Author(s) : David Beazley (beazley@cs.uchicago.edu) * Xml module: Klaus Wiederaenders (kwconsulting@compuserve.com
* *
* Copyright (C) 2002. The University of Chicago * Copyright (C) 2002. The University of Chicago
* See the file LICENSE for information on usage and redistribution. * See the file LICENSE for information on usage and redistribution.
@ -13,8 +13,10 @@
char cvsroot_xml_cxx[] = "$Header$"; char cvsroot_xml_cxx[] = "$Header$";
static const char *usage = "\ static const char *usage = "\
XML Options (available with -xml)\n\ XML Options (available with -xml)\n\
-xml output.xml - Use output.xml as output file (extension .xml mandatory)\n\ -xmllang lang - Typedef language\n\
-xmllang lang - Typedef language.\n\n"; ------\n\
deprecated (use -o): -xml output.xml - Use output.xml as output file (extension .xml mandatory)\n";
#include "swigmod.h" #include "swigmod.h"
@ -48,7 +50,10 @@ public:
{ {
if( strcmp( argv[iX], "-xml" ) == 0 ) if( strcmp( argv[iX], "-xml" ) == 0 )
{ {
char * extension = argv[iX+1]+strlen(argv[iX+1])-4; char * extension = 0;
if( iX + 1 >= argc )
continue;
extension = argv[iX+1]+strlen(argv[iX+1])-4;
if( strcmp( extension, ".xml" ) ) if( strcmp( extension, ".xml" ) )
continue; continue;
iX++; iX++;
@ -84,7 +89,8 @@ public:
if( out == 0 ) if( out == 0 )
{ {
String *outfile = Getattr(n,"outfile"); String *outfile = Getattr(n,"outfile");
Replaceall(outfile,"_wrap.cxx", ".xml"); Replaceall(outfile,".cxx", ".xml");
Replaceall(outfile,".c", ".xml");
out = NewFile(outfile,"w"); out = NewFile(outfile,"w");
if (!out) if (!out)
{ {