#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 35 of file BasicOptionsHandler.cc.
42 (
"help,h",
"produce help message")
45 (
"config,c", bpo::value<std::string>(),
"Configuration file.")
46 (
"process-name", bpo::value<std::string>(),
"art process name.")
48 bpo::value<bool>()->default_value(
true,
to_string(
true)),
49 "Remove unused modules and paths from the fully-processed configuration.")
51 bpo::value<bool>()->default_value(report_unused,
to_string(report_unused)),
52 "If 'true', the list of unused modules and paths will be printed to STDERR.")
54 bpo::value<std::string>(),
55 (
"List all available plugins with the provided suffix. Choose from:"s +
57 (
"print-available-modules",
58 "List all available modules that can be invoked in a FHiCL file.")
59 (
"print-available-services",
60 "List all available services that can be invoked in a FHiCL file.")
62 bpo::value<std::vector<std::string>>()->multitoken(),
63 "Print description of specified module, service, source, or other " 64 "plugin (multiple OK). Argument can be a regular expression used " 65 "to match the plugin specification. To narrow the search to " 66 "plugins with a particular suffix, preface the regular expression" 67 "with the suffix (e.g. service:TFileService).")
69 "Provide status bar that reports the progress of retrieving " 70 "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::BasicOptionsHandler::doCheckOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
overrideprivatevirtual |
Implements art::OptionsHandler.
Definition at line 75 of file BasicOptionsHandler.cc.
79 if (vm.count(
"help")) {
90 bool const status_bar = vm.count(
"status-bar") > 0;
91 if (vm.count(
"print-available")) {
96 if (vm.count(
"print-available-modules")) {
100 if (vm.count(
"print-available-services")) {
106 <<
"The '--status-bar' option can be used only with the " 107 "'--print-available*' program options.\n";
110 if (vm.count(
"print-description")) {
112 vm[
"print-description"].
as<std::vector<std::string>>());
115 if (vm.count(
"version")) {
120 if (!vm.count(
"config")) {
static constexpr double as
std::string const & getReleaseVersion()
void print_available_plugins(std::string const &suffix, std::string const &spec, bool verbose)
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 127 of file BasicOptionsHandler.cc.
135 std::cerr <<
"Failed to parse the configuration file '" 136 << vm[
"config"].as<
std::string>() <<
"' with exception\n" 140 if (raw_config.
empty()) {
141 std::cerr <<
"INFO: provided configuration file '" 142 << vm[
"config"].as<
std::string>() <<
"' is empty: \n" 143 <<
"using minimal defaults and command-line options.\n";
145 if (vm.count(
"process-name")) {
146 raw_config.
put(
"process_name", vm[
"process-name"].as<std::string>());
148 if (vm.count(
"prune-config")) {
149 raw_config.
put(
"services.scheduler.pruneConfig",
150 vm[
"prune-config"].as<bool>());
152 if (vm.count(
"report-unused")) {
153 raw_config.
put(
"services.scheduler.reportUnused",
154 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
bpo::options_description const& art::BasicOptionsHandler::help_desc_ |
|
private |
The documentation for this class was generated from the following files: