#include "BasicOptionsHandler.h"
Definition at line 13 of file BasicOptionsHandler.h.
art::BasicOptionsHandler::BasicOptionsHandler |
( |
bpo::options_description & |
desc, |
|
|
cet::filepath_maker & |
maker, |
|
|
bool |
report_unused |
|
) |
| |
Definition at line 28 of file BasicOptionsHandler.cc.
References art::getReleaseVersion(), maker_, art::Suffixes::print(), art::to_string(), and value.
35 (
"help,h",
"produce help message")
37 (
"config,c", bpo::value<std::string>(),
"Configuration file.")
38 (
"process-name", bpo::value<std::string>(),
"art process name.")
40 bpo::value<bool>()->default_value(
true,
to_string(
true)),
41 "Remove unused modules and paths from the fully-processed configuration.")
43 bpo::value<bool>()->default_value(report_unused,
to_string(report_unused)),
44 "If 'true', the list of unused modules and paths will be printed to STDERR.")
46 bpo::value<std::string>(),
47 (
"List all available plugins with the provided suffix. Choose from:"s +
49 (
"print-available-modules",
50 "List all available modules that can be invoked in a FHiCL file.")
51 (
"print-available-services",
52 "List all available services that can be invoked in a FHiCL file.")
54 bpo::value<std::vector<std::string>>()->multitoken(),
55 "Print description of specified module, service, source, or other " 56 "plugin (multiple OK). Argument can be a regular expression used " 57 "to match the plugin specification. To narrow the search to " 58 "plugins with a particular suffix, preface the regular expression" 59 "with the suffix (e.g. service:TFileService).")
61 "Provide status bar that reports the progress of retrieving " 62 "plugin information for a 'print-available' command.");
static std::string print()
std::string const & getReleaseVersion()
bpo::options_description const & help_desc_
cet::filepath_maker & maker_
std::string to_string(ModuleType const mt)
int art::OptionsHandler::checkOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
inherited |
int art::BasicOptionsHandler::doCheckOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
overrideprivatevirtual |
Implements art::OptionsHandler.
Definition at line 67 of file BasicOptionsHandler.cc.
References art::errors::Configuration, art::getReleaseVersion(), help_desc_, art::detail::info_success(), art::Suffixes::module(), art::detail::print_available_plugins(), art::detail::print_descriptions(), and art::Suffixes::service().
71 if (vm.count(
"help")) {
77 for (std::string s; std::getline(ss, s);)
78 std::cout << std::string(2,
' ') << s <<
'\n';
82 bool const status_bar = vm.count(
"status-bar") > 0;
83 if (vm.count(
"print-available")) {
88 if (vm.count(
"print-available-modules")) {
92 if (vm.count(
"print-available-services")) {
98 <<
"The '--status-bar' option can be used only with the " 99 "'--print-available*' program options.\n";
102 if (vm.count(
"print-description")) {
104 vm[
"print-description"].as<std::vector<std::string>>());
107 if (vm.count(
"version")) {
112 if (!vm.count(
"config")) {
void print_available_plugins(std::string const &suffix, std::string const &spec, bool verbose)
std::string const & getReleaseVersion()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bpo::options_description const & help_desc_
void print_descriptions(std::vector< std::string > const &plugins)
static std::string const & service()
constexpr int info_success()
static std::string const & module()
Implements art::OptionsHandler.
Definition at line 119 of file BasicOptionsHandler.cc.
References e, fhicl::intermediate_table::empty(), maker_, fhicl::parse_document(), and fhicl::intermediate_table::put().
127 std::cerr <<
"Failed to parse the configuration file '" 128 << vm[
"config"].as<std::string>() <<
"' with exception\n" 132 if (raw_config.
empty()) {
133 std::cerr <<
"INFO: provided configuration file '" 134 << vm[
"config"].as<std::string>() <<
"' is empty: \n" 135 <<
"using minimal defaults and command-line options.\n";
137 if (vm.count(
"process-name")) {
138 raw_config.
put(
"process_name", vm[
"process-name"].as<std::string>());
140 if (vm.count(
"prune-config")) {
141 raw_config.
put(
"services.scheduler.pruneConfig",
142 vm[
"prune-config"].as<bool>());
144 if (vm.count(
"report-unused")) {
145 raw_config.
put(
"services.scheduler.reportUnused",
146 vm[
"report-unused"].as<bool>());
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)
cet::filepath_maker & maker_
cet::coded_exception< error, detail::translate > exception
Definition at line 60 of file OptionsHandler.cc.
References art::OptionsHandler::doProcessOptions().
63 std::string
const thisClass(cet::demangle_symbol(
typeid(*this).name()));
64 return exceptionCatcher(
66 thisClass +
"::doProcessOptions()",
virtual int doProcessOptions(bpo::variables_map const &vm, fhicl::intermediate_table &raw_config)=0
bpo::options_description const& art::BasicOptionsHandler::help_desc_ |
|
private |
cet::filepath_maker& art::BasicOptionsHandler::maker_ |
|
private |
The documentation for this class was generated from the following files: