| 279 | } |
| 280 | |
| 281 | void OptionManager::Parse(const int argc, char** argv) { |
| 282 | config::variables_map vmap; |
| 283 | |
| 284 | try { |
| 285 | config::store(config::parse_command_line(argc, argv, *desc_), vmap); |
| 286 | |
| 287 | if (vmap.count("help")) { |
| 288 | std::cout << "The following options can be specified via command-line:\n" |
| 289 | << *desc_; |
| 290 | // NOLINTNEXTLINE(concurrency-mt-unsafe) |
| 291 | exit(EXIT_SUCCESS); |
| 292 | } |
| 293 | |
| 294 | vmap.notify(); |
| 295 | |
| 296 | } catch (std::exception& exc) { |
| 297 | LOG(ERROR) << "Failed to parse options - " << exc.what() << "."; |
| 298 | // NOLINTNEXTLINE(concurrency-mt-unsafe) |
| 299 | exit(EXIT_FAILURE); |
| 300 | } catch (...) { |
| 301 | LOG(ERROR) << "Failed to parse options for unknown reason."; |
| 302 | // NOLINTNEXTLINE(concurrency-mt-unsafe) |
| 303 | exit(EXIT_FAILURE); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | } // namespace glomap |
no outgoing calls
no test coverage detected