LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
fhicl-expand.cc File Reference
#include "boost/program_options.hpp"
#include "cetlib/container_algorithms.h"
#include "cetlib_except/exception.h"
#include "cetlib/filepath_maker.h"
#include "cetlib/includer.h"
#include <fstream>
#include <iostream>
#include <istream>
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 65 of file fhicl-expand.cc.

References e.

66 {
67 
68  Options opts;
69  try {
70  opts = process_arguments(argc, argv);
71  }
72  catch (cet::exception const& e) {
73  if (e.category() == help)
74  return 0;
75  if (e.category() == processing)
76  return 1;
77  }
78 
79  // Set output/error streams
80  std::ofstream outfile(opts.output_filename.c_str());
81  std::ofstream errfile(opts.error_filename.c_str());
82 
83  std::ostream& out = opts.output_filename.empty() ? std::cout : outfile;
84  std::ostream& err = opts.error_filename.empty() ? std::cerr : errfile;
85 
86  auto const policy = get_policy(opts.lookup_policy, opts.lookup_path);
87 
88  int nfailures{};
89  for (std::string const& filename : opts.input_filenames)
90  nfailures += do_including(filename, *policy, out, err);
91 
92  return nfailures;
93 }
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33