15 po::options_description required(
"Required options");
17 required.add_options()
18 (
"setup,s", po::value(&
setup)->value_name(
"<setup>")->required(),
19 "Setup: mCBM2022, mCBM2024")
20 (
"outdir,o", po::value(&
outputDir)->value_name(
"<outputDir>")->required(),
21 "Output directory for the parameter files")
25 po::options_description optional{
"Other options"};
27 optional.add_options()
29 "Do not do alignment")
30 (
"help,h",
"Print help message")
35 po::options_description cmdline_options;
36 cmdline_options.add(required).add(optional);
39 po::command_line_parser parser{argc, argv};
40 parser.options(cmdline_options);
42 auto result = parser.run();
43 po::store(result, vm);
45 catch (
const std::exception& e) {
46 std::cerr <<
"Error: " << e.what() << std::endl;
47 std::cerr <<
"Use '-h' to display all valid options." << std::endl;
48 std::exit(EXIT_FAILURE);
51 if (vm.count(
"help") > 0) {
52 std::cout << cmdline_options << std::endl;
53 std::exit(EXIT_SUCCESS);
59 catch (
const po::required_option& e) {
60 std::cerr <<
"Error: " << e.what() << std::endl;
61 std::cerr <<
"Use '-h' to display all valid options." << std::endl;
62 std::exit(EXIT_FAILURE);