LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fhicl-dump.cc File Reference
#include "cetlib/filepath_maker.h"
#include "cetlib/ostream_handle.h"
#include "cetlib/parsed_program_options.h"
#include "cetlib_except/demangle.h"
#include "fhiclcpp/ParameterSet.h"
#include "fhiclcpp/detail/print_mode.h"
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <variant>

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 53 of file fhicl-dump.cc.

References fhicl::detail::annotated, fhicl::ParameterSet::make(), and fhicl::detail::prefix_annotated.

54 {
55  auto const opts_or_help = process_arguments(argc, argv);
56  if (std::holds_alternative<Help>(opts_or_help)) {
57  std::cout << std::get<Help>(opts_or_help).msg;
58  return 0;
59  }
60 
61  auto const& opts = std::get<Options>(opts_or_help);
62  auto const pset =
63  fhicl::ParameterSet::make(opts.input_filename, *opts.policy);
64 
65  if (opts.quiet)
66  return 0;
67 
68  auto os = cet::select_stream(opts.output_filename, std::cout);
69 
70  os << "# Produced from '" << argv[0] << "' using:\n"
71  << "# Input : " << opts.input_filename << '\n'
72  << "# Policy : "
73  << cet::demangle_symbol(typeid(decltype(*opts.policy)).name()) << '\n'
74  << "# Path : \"" << opts.lookup_path << "\"\n\n"
75  << pset.to_indented_string(0, opts.mode);
76 }
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68