Boost logo

Boost Users :

From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2007-01-21 23:39:49


Hi,

I got the following error for the program list below. Where
program_options considers "help" and "help_abc" as ambiguous?

$ ./main --help
terminate called after throwing an instance of
'boost::program_options::ambiguous_option'
  what(): ambiguous option help
Aborted

Thanks,
Peng

#include <boost/program_options.hpp>
namespace po = boost::program_options;

int main(int ac, char* av[])
{
  po::options_description desc("Allowed options");
  desc.add_options()
    ("help", "produce help message")
    ("help_abc", po::value<int>(), "set compression level")
    ;

  po::variables_map vm;
  po::store(po::parse_command_line(ac, av, desc), vm);
  po::notify(vm);

  return 0;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net