ClickHouse/utils/config-processor/config-processor.cpp
2016-06-07 11:23:15 +03:00

36 lines
674 B
C++

#include <DB/Common/ConfigProcessor.h>
#include <iostream>
int main(int argc, char ** argv)
{
try
{
if (argc != 2)
{
std::cerr << "usage: " << argv[0] << " path" << std::endl;
return 3;
}
ConfigProcessor processor(false, true);
XMLDocumentPtr document = processor.processConfig(argv[1]);
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;
}
return 0;
}