LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
artapp.h File Reference
#include <string>

Go to the source code of this file.

Functions

int artapp (int argc, char *argv[])
 
int artapp_string_config (const std::string &config_string)
 

Function Documentation

int artapp ( int  argc,
char *  argv[] 
)

Definition at line 23 of file artapp.cc.

References ART_RETHROW_DEFAULT, and art::run_art().

Referenced by art_ut(), and main().

24 {
25  // Configuration file lookup policy.
26  char const* fhicl_env = getenv("FHICL_FILE_PATH");
27  std::string search_path;
28  if (fhicl_env == nullptr) {
29  std::cerr << "Expected environment variable FHICL_FILE_PATH is "
30  << "missing or empty: using \".\"\n";
31  search_path = ".";
32  }
33  else {
34  search_path = std::string{fhicl_env};
35  }
36  cet::filepath_first_absolute_or_lookup_with_dot lookupPolicy{search_path};
37  // Empty options_description.
38  bpo::options_description all_desc;
39  // Create and store options handlers.
40  art::OptionsHandlers handlers;
41  handlers.reserve(5); // -ish.
42  // Add new handlers here. Do *not* add a BasicOptionsHandler: it will
43  // be done for you.
44  handlers.emplace_back(new art::BasicSourceOptionsHandler{all_desc});
45  handlers.emplace_back(new art::BasicOutputOptionsHandler{all_desc});
46  handlers.emplace_back(new art::ProcessingOptionsHandler{all_desc, ART_RETHROW_DEFAULT});
47  handlers.emplace_back(new art::DebugOptionsHandler{all_desc,
48  boost::filesystem::path(argv[0]).filename().native()});
49 
50  handlers.emplace_back(new art::FileCatalogOptionsHandler{all_desc});
51  return art::run_art(argc, argv, all_desc, lookupPolicy, std::move(handlers));
52 }
int run_art(int argc, char **argv, bpo::options_description &in_desc, cet::filepath_maker &lookupPolicy, OptionsHandlers &&handlers)
Definition: run_art.cc:123
#define ART_RETHROW_DEFAULT
Definition: artapp.cc:21
std::vector< std::unique_ptr< art::OptionsHandler >> OptionsHandlers
int artapp_string_config ( const std::string &  config_string)