Functions
fhicl-expand.cc File Reference
#include "cetlib/container_algorithms.h"
#include "cetlib/filepath_maker.h"
#include "cetlib/includer.h"
#include "cetlib/ostream_handle.h"
#include "cetlib/parsed_program_options.h"
#include "cetlib_except/exception.h"
#include <iostream>
#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 60 of file fhicl-expand.cc.

61 {
62  Options opts;
63  try {
64  opts = process_arguments(argc, argv);
65  }
66  catch (cet::exception const& e) {
67  if (e.category() == help)
68  return 0;
69  if (e.category() == processing)
70  return 1;
71  }
72 
73  // Set output/error streams
74  auto out = cet::select_stream(opts.output_filename, std::cout);
75  auto err = cet::select_stream(opts.error_filename, std::cerr);
76 
77  int nfailures{};
78  for (std::string const& filename : opts.input_filenames)
79  nfailures += do_including(filename, *opts.policy, out, err);
80 
81  return nfailures;
82 }
ostream_handle select_stream(std::string const &filename, std::ostream &default_os)
std::string string
Definition: nybbler.cc:12
string filename
Definition: train.py:213
const double e
void err(const char *fmt,...)
Definition: message.cpp:226
opts
Definition: ECLAPI.py:241
int do_including(std::string const &from, std::ostream &to)
Definition: inc-expand.cc:21
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33