|
DAS
3.0
Das Analysis System
|
Common class to interpret the command line, based on Boost Program Options.
Options may also be partly provided via a configuration file. Additional options to split the input file are also possible. Minimal working example:
options.arg<
int>(
"myArg",
"correction.here",
"my description");
options.args(
"allOtherArgs",
"correction.there.list",
"garbage collector");
where the config is a Boost Property Tree. A one-liner is even possible:
auto const&
config =
Options(
"Global description.",
Options::config |
Options::split).input(
"input", &
input,
"input ROOT file").output(
"output", &
output,
"output ROOT file").arg<
int>(
"myArg",
"correction.here",
"my description").
args(
"allOtherArgs",
"correction.there.list",
"garbage collector")(argc, argv);
The order matters only for the positional options, where input(s) should be given first, then output(s), then additional positional options. The position of explicit options (e.g. -v
) does not matter. Options::args
may be used as a garbage collector for extra positional options.
#include <Options.h>
|
| Options (const std::string &, int=none, const char *commit=DARWIN_GIT_COMMIT, const char *example=DARWIN_EXAMPLE) |
|
| Options ()=delete |
|
Options & | input (const char *, std::filesystem::path *, const char *) |
|
Options & | inputs (const char *, std::vector< std::filesystem::path > *, const char *) |
|
Options & | output (const char *, std::filesystem::path *, const char *) |
|
template<typename T > |
Options & | arg (const char *name, const char *configpath, const char *desc) |
|
Options & | args (const char *name, const char *configpath, const char *desc) |
|
const boost::property_tree::ptree & | operator() (int, const char *const []) |
|
auto | commit () const |
|
int | steering () const |
|
std::pair< unsigned, unsigned > | slice () const |
|
| Options (const std::string &, int=none, const char *commit=DARWIN_GIT_COMMIT, const char *example=DARWIN_EXAMPLE) |
|
| Options ()=delete |
|
Options & | input (const char *, std::filesystem::path *, const char *) |
|
Options & | inputs (const char *, std::vector< std::filesystem::path > *, const char *) |
|
Options & | output (const char *, std::filesystem::path *, const char *) |
|
template<typename T > |
Options & | arg (const char *name, const char *configpath, const char *desc) |
|
Options & | args (const char *name, const char *configpath, const char *desc) |
|
const boost::property_tree::ptree & | operator() (int, const char *const []) |
|
auto | commit () const |
|
int | steering () const |
|
std::pair< unsigned, unsigned > | slice () const |
|
|
enum | Stage {
Input,
Output,
Arg,
Args,
Input,
Output,
Arg,
Args
} |
|
enum | Stage {
Input,
Output,
Arg,
Args,
Input,
Output,
Arg,
Args
} |
|
|
void | parse_helper (int, const char *const []) |
|
void | parse_common (int, const char *const []) |
|
void | parse_custom (int, const char *const []) |
|
Options & | set (const char *, const boost::program_options::value_semantic *, const char *) |
|
template<typename T > |
std::function< void(T)> | put (const char *configpath) |
|
bool | allow_unregistered () const |
|
std::string | exec (const std::string &) |
|
void | parse_helper (int, const char *const []) |
|
void | parse_common (int, const char *const []) |
|
void | parse_custom (int, const char *const []) |
|
Options & | set (const char *, const boost::program_options::value_semantic *, const char *) |
|
template<typename T > |
std::function< void(T)> | put (const char *configpath) |
|
bool | allow_unregistered () const |
|
std::string | exec (const std::string &) |
|
|
static std::filesystem::path | prefix |
|
◆ Stage [1/2]
Enumerator |
---|
Input | first the inputs
|
Output | then the outputs (inputs are no longer allowed)
|
Arg | then the registered arguments (inputs and outputs no longer allowed)
|
Args | finally the remaining arguments / garbage collector (must be very last)
|
Input | first the inputs
|
Output | then the outputs (inputs are no longer allowed)
|
Arg | then the registered arguments (inputs and outputs no longer allowed)
|
Args | finally the remaining arguments / garbage collector (must be very last)
|
◆ Stage [2/2]
Enumerator |
---|
Input | first the inputs
|
Output | then the outputs (inputs are no longer allowed)
|
Arg | then the registered arguments (inputs and outputs no longer allowed)
|
Args | finally the remaining arguments / garbage collector (must be very last)
|
Input | first the inputs
|
Output | then the outputs (inputs are no longer allowed)
|
Arg | then the registered arguments (inputs and outputs no longer allowed)
|
Args | finally the remaining arguments / garbage collector (must be very last)
|
◆ Options() [1/4]
Constructor:
- contains a parser for the help itself
- contains a parser for the options, like config file and verbosity
- and contains a parser for the input, output, and any other option as positional arguments
- Parameters
-
tuto | description, to be displayed in the helper |
pars | flags for explicit, generic command options (see enum) |
commit | git commit for --git |
example | path to example |
105 (
"prefix,p", po::value<fs::path>(&
prefix),
"Prefix command, `parallel` or `submit` (for history only)");
109 (
"help,h",
"Help screen (what you are seeing right now)")
110 (
"tutorial,t",
"Brief description of the command's purpose")
111 (
"git,g",
"Commit hash of this executable at compilation time");
113 (
"example,e",
"Print config example");
117 (
"verbose,v", po::bool_switch()->default_value(
false),
"Enable debug mode (typically in slow operations such as the event loop)")
118 (
"mute,m" , po::bool_switch()->default_value(
false)->notifier(
set_mute),
"Disable standard output stream");
120 (
"config,c" , po::value<fs::path>(&
config_file),
"Configuration file in INFO, JSON, or XML format");
122 (
"nSplit,j" , po::value<unsigned>(&
j)->default_value(
j),
"Number of slices")
123 (
"nNow,k" , po::value<unsigned>(&
k)->default_value(
k),
"Index of present slice");
125 (
"fill,f", po::bool_switch()->default_value(
false),
"Enable `TTree::Fill()`");
127 (
"Friend,F", po::bool_switch()->default_value(
false),
"Use `TTree` friends instead of cloning the whole input `TTree`");
129 (
"syst,s", po::bool_switch()->default_value(
false),
"Enable systematic variations");
◆ Options() [2/4]
No default constructor is allowed.
◆ Options() [3/4]
Constructor:
- contains a parser for the help itself
- contains a parser for the options, like config file and verbosity
- and contains a parser for the input, output, and any other option as positional arguments
- Parameters
-
commit | git commit for --git |
example | path to example |
◆ Options() [4/4]
No default constructor is allowed.
◆ allow_unregistered() [1/2]
bool allow_unregistered |
( |
| ) |
const |
|
inlineprivate |
◆ allow_unregistered() [2/2]
bool allow_unregistered |
( |
| ) |
const |
|
inlineprivate |
◆ arg() [1/2]
Options& arg |
( |
const char * |
name, |
|
|
const char * |
configpath, |
|
|
const char * |
desc |
|
) |
| |
|
inline |
Member to add an argument. It can be called several times in a row. Each argument may be provided via the configuration file too.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
name | name of the option, will be shown in helper |
configpath | path in config |
desc | description, shown in helper too |
217 if (
stage > Stage::Arg)
218 BOOST_THROW_EXCEPTION(std::runtime_error(
"Not possible to add another argument at this stage"));
223 const boost::program_options::value_semantic * s =
224 boost::program_options::value<T>()->notifier(put<T>(configpath));
◆ arg() [2/2]
Options& arg |
( |
const char * |
name, |
|
|
const char * |
configpath, |
|
|
const char * |
desc |
|
) |
| |
|
inline |
Member to add an argument. It can be called several times in a row. Each argument may be provided via the configuration file too.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
name | name of the option, will be shown in helper |
configpath | path in config |
desc | description, shown in helper too |
217 if (
stage > Stage::Arg)
218 BOOST_THROW_EXCEPTION(std::runtime_error(
"Not possible to add another argument at this stage"));
223 const boost::program_options::value_semantic * s =
224 boost::program_options::value<T>()->notifier(put<T>(configpath));
◆ args() [1/2]
Options& args |
( |
const char * |
name, |
|
|
const char * |
configpath, |
|
|
const char * |
desc |
|
) |
| |
Member to collect any addition arguments provided in command line. It should be called maximum once. The additional options will be collected as a list of strings.
- Parameters
-
name | generic name for unregistered options |
configpath | path in config. |
desc | description, shown in helper too |
◆ args() [2/2]
Options & args |
( |
const char * |
name, |
|
|
const char * |
configpath, |
|
|
const char * |
desc |
|
) |
| |
Member to collect any addition arguments provided in command line. It should be called maximum once. The additional options will be collected as a list of strings.
- Parameters
-
name | generic name for unregistered options |
configpath | path in config. |
desc | description, shown in helper too |
475 if (
stage >= Stage::Args)
476 BOOST_THROW_EXCEPTION(runtime_error(
"Only one garbage collector is possible"));
483 const po::value_semantic * s =
484 po::value<vector<string>>()->multitoken()->zero_tokens();
◆ check_input() [1/2]
void check_input |
( |
const std::filesystem::path & |
input | ) |
|
|
staticprivate |
Function used by Boost Program Options to check if the file does exist, and if yes, if it is readable and readable.
- Parameters
-
39 if (!fs::exists(
input))
40 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"Bad input",
input,
41 make_error_code(errc::no_such_file_or_directory)));
46 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"Input exists but cannot be read",
47 input, make_error_code(errc::permission_denied)));
◆ check_input() [2/2]
static void check_input |
( |
const std::filesystem::path & |
| ) |
|
|
staticprivate |
Function used by Boost Program Options to check if the file does exist, and if yes, if it is readable and readable.
◆ check_output() [1/2]
void check_output |
( |
const std::filesystem::path & |
output | ) |
|
|
staticprivate |
Function used by Boost Program Options to check if the file may already exist, and if yes, then if it is writable, and not a directory. (At this stage, the automatic naming of the output according to the name of the input should not happen. Such a thing should rather be done in the executable directly.)
- Parameters
-
52 fs::path outputHist =
output;
53 if (!
prefix.empty() && !fs::is_directory(
output)) outputHist.remove_filename();
54 full_cmd +=
' ' + outputHist.string();
56 if (!fs::exists(
output))
return;
60 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"Output already exists and cannot be overwritten",
61 output, make_error_code(errc::permission_denied)));
64 if (fs::is_directory(
output) && fs::equivalent(
output,
".")) {
66 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"Not a valid output",
67 output, make_error_code(errc::invalid_argument)));
69 else if (
output !=
"/dev/null")
◆ check_output() [2/2]
static void check_output |
( |
const std::filesystem::path & |
| ) |
|
|
staticprivate |
Function used by Boost Program Options to check if the file may already exist, and if yes, then if it is writable, and not a directory. (At this stage, the automatic naming of the output according to the name of the input should not happen. Such a thing should rather be done in the executable directly.)
◆ commit() [1/2]
◆ commit() [2/2]
◆ exec() [1/2]
std::string exec |
( |
const std::string & |
cmd | ) |
|
|
private |
- Returns
- output from command given to shell
- Parameters
-
cmd | cmd to run in the shell |
412 FILE * pipe = popen(
cmd.c_str(),
"r");
414 if (fgets(buffer, 128, pipe) != NULL)
◆ exec() [2/2]
std::string exec |
( |
const std::string & |
| ) |
|
|
private |
- Returns
- output from command given to shell
◆ input() [1/2]
Options& input |
( |
const char * |
, |
|
|
std::filesystem::path * |
, |
|
|
const char * |
|
|
) |
| |
Member to add an input. It can be called several times in a row. This option should always be provided from the command line, and never via the config file.
- Returns
- the object itself, so that the arguments can be given in a row.
◆ input() [2/2]
Options & input |
( |
const char * |
name, |
|
|
std::filesystem::path * |
file, |
|
|
const char * |
desc |
|
) |
| |
Member to add an input. It can be called several times in a row. This option should always be provided from the command line, and never via the config file.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
name | name of the option, will be shown in helper |
file | path pointer to file |
desc | description, shown in helper too |
399 if (
stage > Stage::Input)
400 BOOST_THROW_EXCEPTION(runtime_error(
"Not possible to add another input at this stage"));
402 const po::value_semantic * s =
403 po::value<fs::path>(file)->notifier(
check_input)->required();
◆ inputs() [1/2]
Options& inputs |
( |
const char * |
, |
|
|
std::vector< std::filesystem::path > * |
, |
|
|
const char * |
|
|
) |
| |
Member to add an undefined amount of input. It can be called only once. This option should always be provided from the command line, and never via the config file. There can be no garbage collector in addition.
- Returns
- the object itself, so that the arguments can be given in a row.
◆ inputs() [2/2]
Options & inputs |
( |
const char * |
name, |
|
|
std::vector< std::filesystem::path > * |
files, |
|
|
const char * |
desc |
|
) |
| |
Member to add an undefined amount of input. It can be called only once. This option should always be provided from the command line, and never via the config file. There can be no garbage collector in addition.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
name | name of the options, will be shown in helper |
files | paths to files |
desc | descriptions |
423 if (
stage > Stage::Input)
424 BOOST_THROW_EXCEPTION(runtime_error(
"Not possible to add another input at this stage"));
426 auto store = [
files,
this](
const string& pathRegex) {
428 const string& ls =
exec(
"ls -1d " + pathRegex);
430 vector<fs::path>
paths;
432 for (fs::path
const&
p:
paths) {
433 if (!fs::exists(
p))
continue;
438 if (
files->empty()) {
439 fs::path
p = pathRegex;
441 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"No input file could be found",
p,
442 make_error_code(errc::no_such_file_or_directory)));
446 [](
string inputs, fs::path
input) { return inputs + fs::canonical(input).string() +
' '; });
448 if (
files->size() > 1)
453 const po::value_semantic * s =
454 po::value<string>()->notifier(store)->required();
455 string full_desc = desc;
456 full_desc +=
" (use a regular expression, surrounded by quotation marks)";
457 return set(
name, s, full_desc.c_str());
◆ operator()() [1/2]
const boost::property_tree::ptree& operator() |
( |
int |
, |
|
|
const char * const |
[] |
|
) |
| |
Unique parser accessible by the user of the class. It should be directly given argc
and argv
from the main function.
◆ operator()() [2/2]
const boost::property_tree::ptree & operator() |
( |
int |
argc, |
|
|
const char * const |
argv[] |
|
) |
| |
Unique parser accessible by the user of the class. It should be directly given argc
and argv
from the main function.
379 catch (
const po::error& e) {
380 BOOST_THROW_EXCEPTION(po::error(e.what()));
◆ output() [1/2]
Options& output |
( |
const char * |
, |
|
|
std::filesystem::path * |
, |
|
|
const char * |
|
|
) |
| |
Member to add an output. It can be called several times in a row. This option should always be provided from the command line, and never via the config file.
- Returns
- the object itself, so that the arguments can be given in a row.
◆ output() [2/2]
Options & output |
( |
const char * |
name, |
|
|
std::filesystem::path * |
file, |
|
|
const char * |
desc |
|
) |
| |
Member to add an output. It can be called several times in a row. This option should always be provided from the command line, and never via the config file.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
name | name of the option, will be shown in helper |
file | path pointer to file |
desc | description, shown in helper too |
462 if (
stage > Stage::Output) {
464 BOOST_THROW_EXCEPTION(runtime_error(
"Not possible to add another output at this stage"));
466 stage = Stage::Output;
468 const po::value_semantic * s =
469 po::value<fs::path>(file)->notifier(
check_output)->required();
◆ parse_common() [1/2]
void parse_common |
( |
int |
argc, |
|
|
const char * const |
argv[] |
|
) |
| |
|
private |
Parser for generic options, such as the config (with -c
) or slices. It should be directly given argc
and argv
from the main function.
239 po::options_description cmd_line;
243 po::command_line_parser
parser{argc, argv};
245 .allow_unregistered();
247 po::variables_map vm;
248 po::store(
parser.run(), vm);
251 if (vm.count(
"config")) {
255 else if (ext ==
".xml" ) {
258 pt_conf = userinfo.get_child(
"userinfo");
260 else BOOST_THROW_EXCEPTION(fs::filesystem_error(
"Extension should be .json, .xml, or .info",
261 config_file, make_error_code(errc::invalid_argument)));
◆ parse_common() [2/2]
void parse_common |
( |
int |
, |
|
|
const char * const |
[] |
|
) |
| |
|
private |
Parser for generic options, such as the config (with -c
) or slices. It should be directly given argc
and argv
from the main function.
◆ parse_config() [1/2]
static void parse_config |
( |
boost::property_tree::ptree & |
, |
|
|
std::string |
= "" |
|
) |
| |
|
static |
Parse config if given. This method calls itself to parse the tree structure.
◆ parse_config() [2/2]
static void parse_config |
( |
boost::property_tree::ptree & |
, |
|
|
std::string |
= "" |
|
) |
| |
|
static |
Parse config if given. This method calls itself to parse the tree structure.
◆ parse_custom() [1/2]
void parse_custom |
( |
int |
, |
|
|
const char * const |
[] |
|
) |
| |
|
private |
Parser for options provided with args()
, defined differently in each application. It should be directly given argc
and argv
from the main function.
◆ parse_custom() [2/2]
void parse_custom |
( |
int |
argc, |
|
|
const char * const |
argv[] |
|
) |
| |
|
private |
Parser for options provided with args()
, defined differently in each application. It should be directly given argc
and argv
from the main function.
272 po::options_description cmd_line;
277 po::command_line_parser
parser{argc, argv};
281 po::variables_map vm;
282 po::parsed_options parsed =
parser.run();
283 po::store(parsed, vm);
288 if (vm.count(
name))
continue;
289 throw po::required_option(
name);
301 auto arg =
pt_conf.get_optional<
string>(configpath);
303 al::erase_all(*
arg,
"\n");
304 al::erase_all(*
arg,
" ");
305 al::erase_all(*
arg,
"\"");
306 if (
arg->empty())
continue;
313 if (!
pt_conf.count(configpath))
314 pt_conf.add<
string>(configpath,
"");
315 auto& subtree =
pt_conf.get_child(configpath);
317 for (
auto& item: subtree) {
318 string key = item.first,
319 value = item.second.get_value<
string>();
320 if (
key.empty() ||
key ==
"item")
322 else if (value.empty())
326 vector<string> items = po::collect_unrecognized(parsed.options,
327 po::include_positional);
330 items.erase(items.begin(), items.begin() + *
registered);
332 for (
auto& item: items) {
333 if (subtree.count(item))
continue;
334 subtree.add<
string>(item,
"");
◆ parse_env_var() [1/6]
static const char* parse_env_var |
( |
const char * |
p | ) |
|
|
inlinestatic |
Parse environment variable in C-style string.
◆ parse_env_var() [2/6]
static const char* parse_env_var |
( |
const char * |
p | ) |
|
|
inlinestatic |
Parse environment variable in C-style string.
◆ parse_env_var() [3/6]
static std::filesystem::path parse_env_var |
( |
const std::filesystem::path & |
p | ) |
|
|
inlinestatic |
Parse environment variable in a path.
◆ parse_env_var() [4/6]
static std::filesystem::path parse_env_var |
( |
const std::filesystem::path & |
p | ) |
|
|
inlinestatic |
Parse environment variable in a path.
◆ parse_env_var() [5/6]
string parse_env_var |
( |
std::string |
s | ) |
|
|
static |
◆ parse_env_var() [6/6]
static std::string parse_env_var |
( |
std::string |
| ) |
|
|
static |
◆ parse_helper() [1/2]
void parse_helper |
( |
int |
, |
|
|
const char * const |
[] |
|
) |
| |
|
private |
First parser that is called. As soon as -h
is given, or if the command is run without options, then the helper is shown. It should be directly given argc
and argv
from the main function.
◆ parse_helper() [2/2]
void parse_helper |
( |
int |
argc, |
|
|
const char * const |
argv[] |
|
) |
| |
|
private |
First parser that is called. As soon as -h
is given, or if the command is run without options, then the helper is shown. It should be directly given argc
and argv
from the main function.
173 po::command_line_parser
parser{argc, argv};
175 .allow_unregistered();
178 po::variables_map vm;
179 po::store(
parser.run(), vm);
182 if (vm.count(
"help") || argc == 1) {
183 fs::path executable = argv[0];
186 for (
const auto& option:
custom.options())
187 cout <<
'\t' << option->long_name() <<
" = " << option->description() <<
'\n';
190 if (vm.count(
"help")) {
191 po::options_description cmd_line;
194 cout << cmd_line << endl;
197 if (vm.count(
"tutorial"))
200 "unless stated otherwise, all options except the input(s) and output files "
201 "may be given either from the command line or from such a config. Unused "
202 "options in the config are simply ignored. The `flags` should be set at "
203 "the creation of the n-tuples; the `corrections` should be added step "
204 "by step (typically a couple of corrections per executable at most). How "
205 "the config is parsed may change from executable to executable. This "
206 "example uses the Boost INFO format, but JSON and XML formats are also "
207 "possible. It is possible to extract such a config from an existing ROOT "
208 "file by using `getMetaInfo`. Arguments from command line overwrite "
209 "arguments from the config.") << endl;
214 if (vm.count(
"example")) {
216 BOOST_THROW_EXCEPTION(fs::filesystem_error(
"The example could not be found",
217 example, make_error_code(errc::no_such_file_or_directory)));
220 pt::ptree reduced_config;
223 reduced_config.add<
string>(
key, value);
227 write_info(ss, reduced_config);
228 string str = ss.str();
229 al::erase_all(str,
"\"\"");
230 cout << str << flush;
233 if (!vm.empty() || argc == 1)
◆ put() [1/2]
std::function<void(T)> put |
( |
const char * |
configpath | ) |
|
|
inlineprivate |
Helper to call boost::property_tree::put
in Darwin::Toos::Options::args
.
- Returns
true
if Options::registered
has been initialised.
- Parameters
-
configpath | path in config file |
126 return [configpath,
this](T value) {
pt_conf.put<T>(configpath, value); };
◆ put() [2/2]
std::function<void(T)> put |
( |
const char * |
configpath | ) |
|
|
inlineprivate |
Helper to call boost::property_tree::put
in Darwin::Toos::Options::args
.
- Returns
true
if Options::registered
has been initialised.
- Parameters
-
configpath | path in config file |
126 return [configpath,
this](T value) {
pt_conf.put<T>(configpath, value); };
◆ set() [1/2]
Options& set |
( |
const char * |
, |
|
|
const boost::program_options::value_semantic * |
, |
|
|
const char * |
|
|
) |
| |
|
private |
◆ set() [2/2]
Options & set |
( |
const char * |
name, |
|
|
const boost::program_options::value_semantic * |
s, |
|
|
const char * |
desc |
|
) |
| |
|
private |
Generic code to add options. It is called internally by Options::input()
, Options::output()
, and Options::args()
.
- Returns
- the object itself, so that the arguments can be given in a row.
- Parameters
-
389 BOOST_THROW_EXCEPTION(invalid_argument(
"Once `Options::args()` has been called, "
390 "it is no longer possible to add any further options."));
◆ slice() [1/2]
std::pair<unsigned, unsigned> slice |
( |
| ) |
const |
|
inline |
Compactify slice information into a pair.
281 BOOST_THROW_EXCEPTION(std::invalid_argument(
"No splitting of the input file."));
282 return std::make_pair(
j,
k);
◆ slice() [2/2]
std::pair<unsigned, unsigned> slice |
( |
| ) |
const |
|
inline |
Compactify slice information into a pair.
281 BOOST_THROW_EXCEPTION(std::invalid_argument(
"No splitting of the input file."));
282 return std::make_pair(
j,
k);
◆ steering() [1/2]
Steering information for running of executable.
◆ steering() [2/2]
Steering information for running of executable.
◆ common
boost::program_options::options_description common |
|
private |
generic + explicit options like --verbose
◆ config_file
std::filesystem::path config_file |
|
private |
path to INFO, JSON, or XML config file
◆ configpaths
std::vector< std::string > configpaths |
|
private |
path to the options in config (except for I/O)
◆ custom
boost::program_options::options_description custom |
|
private |
for positional arguments, depending on the actual command
◆ example
const std::filesystem::path example |
|
private |
◆ full_cmd
static std::string full_cmd |
|
static |
extended version of the command for reproducibility
◆ helper
boost::program_options::options_description helper |
|
private |
◆ hidden
boost::program_options::options_description hidden |
|
private |
hidden interface (not for lambda user)
◆ m_commit
const std::string m_commit |
|
private |
◆ names
std::vector< std::string > names |
|
private |
names of the different options (shown in synopsis
)
◆ params
input parameters to interpret explicit options
◆ pos_hide
boost::program_options::positional_options_description pos_hide |
|
private |
parser for positional arguments
◆ prefix
static std::filesystem::path prefix |
|
staticprivate |
prefix command to steer -j
and -k
◆ pt_conf
boost::property_tree::ptree pt_conf |
|
private |
internal config obtained from arugments and input config
◆ registered
std::optional< unsigned > registered |
|
private |
collect the number of registered options (only if Options::args
has been called before)
◆ stage
◆ steer
output parameters for code executation
◆ synopsis
stores the clean version of the command, displayed with -h
◆ tutorial
const std::string tutorial |
|
private |
define in constructor, shown with option -t
The documentation for this class was generated from the following files:
- /builds/cms-analysis/general/DasAnalysisSystem/Core/Installer/Darwin/interface/Options.h
- /builds/cms-analysis/general/DasAnalysisSystem/Core/Installer/Darwin/src/Options.cc
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
cerr
Definition: Ntupliser_cfg.py:93
options
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:41
static const char * def
Definition: Step.h:36
paths
Definition: Ntupliser_cfg.py:299
p
Definition: Ntupliser_cfg.py:361
string key
Definition: jercExample.py:109
files
Definition: compareFiles.py:125
static const char * red
Definition: Step.h:34
cmd
Definition: Core-cfgcmd.txt:1
config
Definition: Ntupliser_cfg.py:263
static const char * orange
Definition: colours.h:6
string wrap_paragraph(const string &text)
Definition: Options.cc:137
#define DARWIN_VERSION
Definition: version.h:1
parser
Definition: compareFiles.py:118
DAS::FourVector match(const DAS::FourVector &jet, const std::vector< DAS::FourVector > *hltJets)
Definition: match.h:7
void set_mute(bool flag)
Function used by Boost::PO to disable standard error.
Definition: Options.cc:90
static const char * bold
Definition: Step.h:35