8#include <boost/program_options.hpp>
13namespace po = boost::program_options;
23 po::options_description desc(
"Allowed options");
24 desc.add_options()(
"inputfile,i", po::value<std::string>(&this->
qaFile)->required()->value_name(
"<qaFile.root>"),
25 "Input QA ROOT file")(
26 "setup,s", po::value<std::string>(&this->
setup)->required()->value_name(
"<setupTag>"),
"Setup tag (e.g. s100c)")(
27 "out-dir,o", po::value<std::string>(&this->
outDir)->default_value(
"./report"),
28 "Output directory")(
"engine,e", po::value<std::string>(&this->
engine)->default_value(
"latex"),
29 "Report engine: html | latex | beamer")(
30 "fig-ext,f", po::value<std::string>(&this->
figExt)->default_value(
"png"),
31 "Figure file extension")(
"ignoresame,r", po::bool_switch(&this->
ignoreSame)->default_value(
false),
32 "Ignore same results")(
"help,h",
"Show help message (ignored no printing here)");
35 po::variables_map vars;
36 po::store(po::parse_command_line(argc, argv, desc), vars);
39 if (vars.count(
"help")) {
40 std::cout << desc << std::endl;
48 if (this->
qaFile.empty() || this->setup.empty()) {
49 throw std::runtime_error(
"Missing required options: --qa-file and --setup are mandatory.");
52 catch (
const po::error& e) {
53 std::cerr <<
"Error: " << e.what() << std::endl;
54 std::cerr <<
"Use -h or --help for usage information." << std::endl;
std::string figExt
png | svg | pdf
std::string engine
html | latex | beamer
bool ignoreSame
ignore "same" results in comparison tables
void ParseCommandLine(int argc, char *argv[])
Parses command-line arguments.
std::string setup
setup tag
ApplicationParameter(int argc, char *argv[])
Constructor: Parses command-line arguments.
std::string outDir
where figures & script will go
std::string qaFile
input ROOT file