Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2004-08-02 19:57:54

I'm writing a program with program_options (very cool and useful library, BTW)
and I found myself wanting to print out the variable_map values for debugging
purposes. Is there an easy way to do this?

Also couple of documentation nits:
1) From the first example....

 if (vm.count("help")) {
      std::cout << desc << "\n";

I had to read the code to figure out that variable_map inherits from std::map,
and this is why you can call this. Documentation only says:

 class variables_map
  : : public boost::program_options::abstract_variables_map
2) In the 'Storage Component' section -- there's this:

 Let's consider an example:

        variables_map vm;
        store(parse_command_line(argc, argv, desc), vm);
        store(parse_config_file("example.cfg", desc), vm);
 Finally the call to notify function runs user-specified notify
 functions and stores values into regular variables, if needed.

I assume 'finish' is supposed to be notify? I don't see any docs for finish.


Boost list run by bdawes at, gregod at, cpdaniel at, john at