R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BProgramOptions.cxx
Go to the documentation of this file.
1#include "R3BProgramOptions.h"
2
3namespace R3B
4{
5 auto ProgramOptions::verify(int argc, char** argv) -> bool
6 {
7 try
8 {
9 po::store(po::command_line_parser(argc, argv).positional(pos_desc_).options(desc_).run(), varMap_);
10 po::notify(varMap_);
11
12 if (varMap_.count("help") == 1)
13 {
14 std::cout << get_desc_ref() << std::endl;
15 return false;
16 }
17
18 for (auto& registrie : registries_)
19 {
20 registrie.second->retrieve(varMap_);
21 }
22 }
23 catch (const std::runtime_error& err)
24 {
25 std::cerr << "An exception occurs: " << err.what() << std::endl;
26 return false;
27 }
28 catch (const std::exception& err)
29 {
30 // std::cerr << "exception occurs: " << boost::diagnostic_information(err) << std::endl;
31 std::cerr << "An exception occurs: " << err.what() << std::endl;
32 return false;
33 }
34 catch (...)
35 {
36 std::cerr << "An unrecognizable exception occurs!" << std::endl;
37 return false;
38 }
39 return true;
40 }
41} // namespace R3B
auto get_desc_ref() -> auto &
auto verify(int argc, char **argv) -> bool