| 452 | } |
| 453 | |
| 454 | int Server::run() |
| 455 | { |
| 456 | if (config().hasOption("help")) |
| 457 | { |
| 458 | Poco::Util::HelpFormatter help_formatter(Server::options()); |
| 459 | auto header_str = fmt::format("{} [OPTION] [-- [ARG]...]\n" |
| 460 | "positional arguments can be used to rewrite config.xml properties, for example, --http_port=8010", |
| 461 | commandName()); |
| 462 | help_formatter.setHeader(header_str); |
| 463 | help_formatter.format(std::cout); |
| 464 | return 0; |
| 465 | } |
| 466 | if (config().hasOption("version")) |
| 467 | { |
| 468 | std::cout << VERSION_NAME << " server version " << VERSION_STRING << VERSION_OFFICIAL << "." << std::endl; |
| 469 | return 0; |
| 470 | } |
| 471 | return Application::run(); // NOLINT |
| 472 | } |
| 473 | |
| 474 | void Server::initialize(Poco::Util::Application & self) |
| 475 | { |