#include "BasicOptionsHandler.h"
Definition at line 15 of file BasicOptionsHandler.h.
art::BasicOptionsHandler::BasicOptionsHandler |
( |
bpo::options_description & |
desc, |
|
|
cet::filepath_maker & |
maker |
|
) |
| |
Definition at line 31 of file BasicOptionsHandler.cc.
References art::add_opt(), art::getReleaseVersion(), maker_, art::Suffixes::print(), s, and fhicl::detail::atom::value().
35 auto options = desc.add_options();
36 add_opt(options,
"help,h",
"produce help message");
43 options,
"config,c", bpo::value<std::string>(),
"Configuration file.");
45 options,
"process-name", bpo::value<std::string>(),
"art process name.");
49 bpo::value<std::string>(),
50 (
"List all available plugins with the provided suffix. Choose from:"s +
54 "print-available-modules",
55 "List all available modules that can be invoked in a FHiCL file.");
57 "print-available-services",
58 "List all available services that can be invoked in a FHiCL file.");
61 bpo::value<std::vector<std::string>>()->multitoken(),
62 "Print description of specified module, service, source, or other " 63 "plugin (multiple OK). Argument can be a regular expression used " 64 "to match the plugin specification. To narrow the search to " 65 "plugins with a particular suffix, preface the regular expression" 66 "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.");
void add_opt(T &t, Args &&...args)
static std::string print()
std::string const & getReleaseVersion()
bpo::options_description const & help_desc_
std::string value(boost::any const &)
cet::filepath_maker & maker_
int art::OptionsHandler::checkOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
inherited |
Definition at line 51 of file OptionsHandler.cc.
53 std::string
const thisClass(cet::demangle_symbol(
typeid(*this).name()));
54 return exceptionCatcher([&vm,
this] {
return doCheckOptions(vm); },
55 thisClass +
"::doCheckOptions()",
virtual int doCheckOptions(bpo::variables_map const &vm)=0
int art::BasicOptionsHandler::doCheckOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
overrideprivatevirtual |
Implements art::OptionsHandler.
Definition at line 74 of file BasicOptionsHandler.cc.
References art::errors::Configuration, art::Suffixes::get(), art::getReleaseVersion(), help_desc_, art::detail::info_success(), art::module, art::detail::print_available_plugins(), art::detail::print_descriptions(), s, art::service, and ss.
78 if (vm.count(
"help")) {
84 for (std::string
s; std::getline(ss,
s);)
85 std::cout << std::string(2,
' ') <<
s <<
'\n';
89 bool const status_bar = vm.count(
"status-bar") > 0;
90 if (vm.count(
"print-available")) {
92 Suffixes::get(vm[
"print-available"].as<std::string>()), status_bar);
95 if (vm.count(
"print-available-modules")) {
99 if (vm.count(
"print-available-services")) {
105 <<
"The '--status-bar' option can be used only with the " 106 "'--print-available*' program options.\n";
109 if (vm.count(
"print-description")) {
111 vm[
"print-description"].as<std::vector<std::string>>());
114 if (vm.count(
"version")) {
119 if (!vm.count(
"config")) {
std::string const & getReleaseVersion()
void print_available_plugins(suffix_type st, bool const verbose, std::string const &spec)
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 & get(suffix_type st)
constexpr int info_success()
Implements art::OptionsHandler.
Definition at line 126 of file BasicOptionsHandler.cc.
References e, fhicl::intermediate_table::empty(), maker_, fhicl::parse_document(), and fhicl::intermediate_table::put().
134 std::cerr <<
"Failed to parse the configuration file '" 135 << vm[
"config"].as<std::string>() <<
"' with exception\n" 139 if (raw_config.
empty()) {
140 std::cerr <<
"INFO: provided configuration file '" 141 << vm[
"config"].as<std::string>() <<
"' is empty: \n" 142 <<
"using minimal defaults and command-line options.\n";
144 if (vm.count(
"process-name")) {
145 raw_config.
put(
"process_name", vm[
"process-name"].as<std::string>());
cet::filepath_maker & maker_
cet::coded_exception< error, detail::translate > exception
void parse_document(std::string const &filename, cet::filepath_maker &maker, intermediate_table &result)
Definition at line 60 of file OptionsHandler.cc.
Referenced by art::run_art_string_config().
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: