| 707 | } |
| 708 | |
| 709 | int Server::run() |
| 710 | { |
| 711 | if (config().hasOption("help")) |
| 712 | { |
| 713 | Poco::Util::HelpFormatter help_formatter(Server::options()); |
| 714 | std::string app_name = (commandName() == "clickhouse-server") ? "clickhouse-server" : "clickhouse server"; |
| 715 | auto header_str = fmt::format("{} [OPTION] [-- [ARG]...]\n" |
| 716 | "positional arguments can be used to rewrite config.xml properties, for example, --http_port=8010", |
| 717 | app_name); |
| 718 | help_formatter.setHeader(header_str); |
| 719 | help_formatter.format(std::cout); |
| 720 | return 0; |
| 721 | } |
| 722 | if (config().hasOption("version")) |
| 723 | { |
| 724 | std::cout << VERSION_NAME << " server version " << VERSION_STRING << VERSION_OFFICIAL << "." << std::endl; |
| 725 | return 0; |
| 726 | } |
| 727 | return Application::run(); // NOLINT |
| 728 | } |
| 729 | |
| 730 | void Server::initialize(Poco::Util::Application & self) |
| 731 | { |
no test coverage detected