#include <list>
#include <stdexcept>
#include <boost/lexical_cast.hpp>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
//! convert string to upper case
std::string
header_file(const char* fname) : std::ofstream(fname) {
std::cerr << "create header: '" << fname << "'" << std::endl;
std::string macro(replace(toupper(fname),'.','_'));
- *this << "// automatically generated code - do not edit\n" << std::endl;
+ *this << "// automatically generated code (generated by libt2n-codegen " << VERSION << ") - do not edit\n" << std::endl;
*this << "#ifndef " << macro << "\n"
<< "#define " << macro << "\n";
}
int
main(int argc, char* argv[])
{
- if (argc < 3) {
- std::cerr << "Usage: " << argv[0] << "default-group gccxml-file1 gccxml-file2 ... " << std::endl;
- return 1;
- }
+ // todo: maybe use getopt
+ if ((argc>1)&&(std::string(argv[1])=="--version")) {
+ std::cerr << VERSION << std::endl;
+ return 0;
+ }
+ if (argc < 3)
+ {
+ std::cerr << "Usage: " << argv[0] << "default-group gccxml-file1 gccxml-file2 ... " << std::endl;
+ return 1;
+ }
- try{
+ try{
std::string group(argv[1]);
std::list<std::string> xmlfiles;
for (int i=2;i<argc;++i)