2018-02-28 20:34:25 +00:00
|
|
|
#include <Common/Config/ConfigProcessor.h>
|
2014-02-26 19:10:00 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if (argc != 2)
|
|
|
|
{
|
|
|
|
std::cerr << "usage: " << argv[0] << " path" << std::endl;
|
|
|
|
return 3;
|
|
|
|
}
|
2014-02-26 19:10:00 +00:00
|
|
|
|
2018-11-27 16:11:46 +00:00
|
|
|
DB::ConfigProcessor processor(argv[1], false, true);
|
|
|
|
DB::XMLDocumentPtr document = processor.processConfig();
|
2017-04-01 07:20:54 +00:00
|
|
|
Poco::XML::DOMWriter().writeNode(std::cout, document);
|
|
|
|
}
|
|
|
|
catch (Poco::Exception & e)
|
|
|
|
{
|
|
|
|
std::cerr << "Exception: " << e.displayText() << std::endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
catch (std::exception & e)
|
|
|
|
{
|
|
|
|
std::cerr << "std::exception: " << e.what() << std::endl;
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
std::cerr << "Some exception" << std::endl;
|
|
|
|
return 2;
|
|
|
|
}
|
2014-02-26 19:10:00 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return 0;
|
2014-02-26 19:10:00 +00:00
|
|
|
}
|