parsed_program_options.cc
Go to the documentation of this file.
2 #include "cetlib_except/exception.h"
3 
4 namespace bpo = boost::program_options;
5 
6 bpo::variables_map
8  int argc,
9  char** argv,
10  bpo::options_description const& desc,
11  bpo::positional_options_description const& pos) try {
12  bpo::variables_map result;
13  bpo::store(bpo::command_line_parser(argc, argv)
14  .options(desc)
15  .style(bpo::command_line_style::default_style &
16  ~bpo::command_line_style::allow_guessing)
17  .positional(pos)
18  .run(),
19  result);
20  bpo::notify(result);
21  return result;
22 }
23 catch (bpo::error& err) {
24  std::ostringstream err_stream;
25  err_stream << "Error processing command line in " << argv[0] << ": "
26  << err.what() << '\n';
27  throw cet::exception("Processing") << err_stream.str();
28 }
static QCString result
boost::program_options::variables_map parsed_program_options(int argc, char **argv, boost::program_options::options_description const &desc, boost::program_options::positional_options_description const &pos={})
error
Definition: include.cc:26
void err(const char *fmt,...)
Definition: message.cpp:226
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33