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

Go to the source code of this file.

Functions

int artapp (int argc, char *argv[], bool report_unused=true)
 

Function Documentation

int artapp ( int  argc,
char *  argv[],
bool  report_unused = true 
)

Definition at line 26 of file artapp.cc.

References art::run_art().

Referenced by art_ut(), and main().

27 {
28  // Configuration file lookup policy.
29  string search_path;
30  if (char const* fhicl_env = std::getenv("FHICL_FILE_PATH")) {
31  search_path = string{fhicl_env};
32  } else {
33  cerr << "Expected environment variable FHICL_FILE_PATH is missing or "
34  "empty: using \".\"\n";
35  search_path = ".";
36  }
37  cet::filepath_first_absolute_or_lookup_with_dot lookupPolicy{search_path};
38 
39  // Create and store options handlers.
40  ostringstream descstr;
41  descstr << "\nUsage: " << boost::filesystem::path(argv[0]).filename().native()
42  << " <-c <config-file>> <other-options> [<source-file>]+\n\n"
43  << "Basic options";
44  bpo::options_description all_desc{descstr.str()};
45  art::OptionsHandlers handlers;
46  handlers.reserve(7);
47  // BasicOptionsHandler should always be first in the list!
48  handlers.emplace_back(
49  new art::BasicOptionsHandler{all_desc, lookupPolicy, report_unused});
50  // Additional options
51  handlers.emplace_back(new art::BasicSourceOptionsHandler{all_desc});
52  handlers.emplace_back(new art::BasicOutputOptionsHandler{all_desc});
53  handlers.emplace_back(new art::ProcessingOptionsHandler{all_desc});
54  handlers.emplace_back(new art::DebugOptionsHandler{all_desc});
55  handlers.emplace_back(new art::FileCatalogOptionsHandler{all_desc});
56  // BasicPostProcessor should be last.
57  handlers.emplace_back(new art::BasicPostProcessor);
58  return art::run_art(argc, argv, all_desc, std::move(handlers));
59 }
std::vector< std::unique_ptr< art::OptionsHandler >> OptionsHandlers
int run_art(int argc, char **argv, bpo::options_description &all_desc, OptionsHandlers &&handlers)
Definition: run_art.cc:142