15 po::options_description required(
"Required options");
17 required.add_options()
18 (
"run,r", po::value(&
runId)->value_name(
"<runID>")->required(),
20 (
"outdir,o", po::value(&
outputDir)->value_name(
"<outputDir>")->required(),
21 "Output directory for the parameter files")
22 (
"geo,g", po::value(&
geoFileDir)->value_name(
"<geoFileDir>")->required(),
23 "Directory, which contains a valid geometry ROOT-file (*.geo.root) the run")
27 po::options_description optional{
"Other options"};
29 optional.add_options()
31 "Do not do alignment")
33 "Copy existing parameters for unpackers and hitfinders from the repository; create tracking parameters")
34 (
"help,h",
"Print help message")
39 po::options_description cmdline_options;
40 cmdline_options.add(required).add(optional);
43 po::command_line_parser parser{argc, argv};
44 parser.options(cmdline_options);
46 auto result = parser.run();
47 po::store(result, vm);
49 catch (
const std::exception& e) {
50 std::cerr <<
"Error: " << e.what() << std::endl;
51 std::cerr <<
"Use '-h' to display all valid options." << std::endl;
52 std::exit(EXIT_FAILURE);
55 if (vm.count(
"help") > 0) {
56 std::cout << cmdline_options << std::endl;
57 std::exit(EXIT_SUCCESS);
63 catch (
const po::required_option& e) {
64 std::cerr <<
"Error: " << e.what() << std::endl;
65 std::cerr <<
"Use '-h' to display all valid options." << std::endl;
66 std::exit(EXIT_FAILURE);