File: config-processor.cpp

package info (click to toggle)
clickhouse 18.16.1%2Bds-7.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 40,292 kB
  • sloc: cpp: 223,075; sql: 21,608; python: 6,596; sh: 4,299; ansic: 3,889; xml: 3,312; perl: 155; makefile: 57; asm: 34
file content (35 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <Common/Config/ConfigProcessor.h>
#include <iostream>

int main(int argc, char ** argv)
{
    try
    {
        if (argc != 2)
        {
            std::cerr << "usage: " << argv[0] << " path" << std::endl;
            return 3;
        }

        DB::ConfigProcessor processor(argv[1], false, true);
        DB::XMLDocumentPtr document = processor.processConfig();
        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;
}