| 160 | } |
| 161 | |
| 162 | int Keeper::run() |
| 163 | { |
| 164 | if (config().hasOption("help")) |
| 165 | { |
| 166 | Poco::Util::HelpFormatter help_formatter(Keeper::options()); |
| 167 | std::string app_name = (commandName() == "clickhouse-keeper") ? "clickhouse-keeper" : "clickhouse keeper"; |
| 168 | auto header_str = fmt::format("{0} [OPTION] [-- [ARG]...]\n" |
| 169 | #if ENABLE_CLICKHOUSE_KEEPER_CLIENT |
| 170 | "{0} client [OPTION]\n" |
| 171 | #endif |
| 172 | "positional arguments can be used to rewrite config.xml properties, for example, --http_port=8010", |
| 173 | app_name); |
| 174 | help_formatter.setHeader(header_str); |
| 175 | help_formatter.format(std::cout); |
| 176 | return 0; |
| 177 | } |
| 178 | if (config().hasOption("version")) |
| 179 | { |
| 180 | std::cout << VERSION_NAME << " keeper version " << VERSION_STRING << VERSION_OFFICIAL << "." << std::endl; |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | return Application::run(); // NOLINT |
| 185 | } |
| 186 | |
| 187 | void Keeper::initialize(Poco::Util::Application & self) |
| 188 | { |
no test coverage detected