18 std::vector<boost::program_options::option> final_opts_parser(std::vector<std::string>&
args) {
19 std::vector<boost::program_options::option>
result;
21 if (!
args.empty() and !
args[0].empty()) {
22 if (
args[0][0] !=
'-') {
25 }
else if (
args[0] ==
"--" and
args.size() > 1) {
30 if (!configName.empty()) {
33 auto& pythonOpts =
result.back();
35 pythonOpts.value.reserve(
args.size());
36 pythonOpts.original_tokens.reserve(
args.size());
38 pythonOpts.value.push_back(
arg);
39 pythonOpts.original_tokens.push_back(
arg);
42 if (pythonOpts.value.empty()) {
44 pythonOpts.original_tokens.push_back(
"");
54 : desc_(
std::
string(
name) +
" [options] [--] config_file [python options]\nAllowed options"),
55 all_options_(
"All Options") {
59 boost::program_options::value<std::string>(),
60 "file name to use for a job report file: default extension is .xml")(
63 boost::program_options::value<std::string>(),
64 "Job Mode for MessageLogger defaults - default mode is grid")(
66 boost::program_options::value<unsigned int>(),
67 "Number of threads to use in job (0 is use all CPUs)")(
69 boost::program_options::value<unsigned int>(),
70 "Size of stack in KB to use for extra threads (0 is use system default size)")(
kStrictOpt,
"strict parsing")(
71 kCmdCommandOpt, boost::program_options::value<std::string>(),
"config passed in as string (cannot be used with config_file)");
81 boost::program_options::options_description hidden(
"hidden options");
82 hidden.add_options()(
"fwk",
"For use only by Framework Developers")(
83 kParameterSetOpt, boost::program_options::value<std::string>(),
"configuration file")(
86 "options at the end to be passed to python");
91 boost::program_options::variables_map vm;
93 store(boost::program_options::command_line_parser(
argc,
argv)
94 .extra_style_parser(final_opts_parser)
102 <<
"cmsRun: Error while trying to process command line arguments:\n" 103 << iException.what() <<
"\nFor usage and an options list, please do 'cmsRun --help'.";
115 const auto& pythonOptValues = vm[
kPythonOpt].as<std::vector<std::string>>();
static const char *const kEnableJobreportCommandOpt
boost::program_options::options_description desc_
static const char *const kJobModeCommandOpt
static const char *const kStrictOpt
void HaltMessageLogging()
boost::program_options::positional_options_description pos_options_
static const char *const kHelpOpt
static const char *const kParameterSetOpt
static const char *const kHelpCommandOpt
std::variant< boost::program_options::variables_map, int > MapOrExit
static const char *const kCmdCommandOpt
static const char *const kSizeOfStackForThreadCommandOpt
CmsRunParser(const char *name)
boost::program_options::options_description all_options_
static const char *const kPythonOpt
static const char *const kJobreportCommandOpt
Log< level::System, true > LogAbsolute
static const char *const kPythonOptDefault
static const char *const kNumberOfThreadsCommandOpt
MapOrExit parse(int argc, const char *argv[]) const