Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-03-26 04:17:47

Vladimir Prus wrote:

> > 1. the parse_command_line() function taking a vector<> of
> the arguments
> > doesn't exist anymore. Is it possible to re-add it? This
> seems to be as
> > easy as adding:
> The problem is that the number of overloads of
> 'parse_command_line' was too
> high. What about using
> vector<string> v;
> command_line_parser(v).options(desc).run()
> ? This syntax essentially emulated named function parameters
> and avoid the
> need to have large number of overloads.

Ok, this works. But isn't it better to add this single parse_command_line
overload anyway? IMHO the vector<> based version is of major interest. If
not, your solution should be added to a How to? Section inside the docs.

> > 2. The examples doesn't seem to be updated to the new po
> interface (at
> > least the real.cpp and regex.cpp examples)
> Yes, 'real.cpp' and 'regex.cpp' are out-of-date, that's why
> they are not built
> by Jamfile. I'll try to do something about it.

Ok, that's fine. I would like to see more examples though.

> 1. Use 'positional_options_descriptions' to handle positional
> options too.
> 2. The 'parsed_options' class returned by the parser has a
> vector of 'option'
> instance. An option which has 'position_key' not equal to -1
> is positional
> option. So can run remove_copy_if to get positional options

This should be added to a How to? section of the documentation too.

> > to use. I would very much like to keep Wave compatible with the
> > pre-released version of the po library too!
> > Certainly, this issue seems to be important until the next
> Boost release
> > only, but this may take some time and even then I would
> like to support the
> > usage of Boost at least beginning with the V1.30.2.
> That's a question. I meant that it would work like this:
> 1. I retain the prereview version on my site and on
> 2. When you have the time you upgrade the syntax to the new
> one and notify me
> 3. I remove the old version. At this moment, users would have
> to obtains the
> new version of program_options. It's possible to use
> BOOST_PROGRAM_OPTIONS_VERSION and #error to produce nice
> message "Please get
> new program_options library" rather then a number of
> compilation failures.
> This means some work for users, but it's one-time. On the
> contrary, supporting
> two syntaxes at the same time might be really hard.

Ok, I would like to do the following. Since there are two versions of Wave
out anyway (a stable version 1.0.x and the boostified development version
1.1.x, which BTW is the one submitted for Boost review), I would change only
the development version to match the new interface.

This would require
- to add the mentioned BOOST_PROGRAM_OPTIONS_VERSION (for issuing an #error
for the stable Wave)
- to hold the review Boost.ProgramOptions library version for some time from
now on available (at least until Wave possibly passes Boost review, after
which I would release Wave 1.2.0). This could be done on your site, but it
is also possible to boundle the 'old' po with the stable Wave version.


> > 7. What's the equivalent for the parameter and validator
> classes, which
> > were contained in the reviewed version?
> By validator, you mean the way you handle 'include_paths'
> class in Wave?
> The syntax you've used is gone, but you can achieve the same
> effect with
> specialization of the 'validator' class:
> template<>
> void validator<include_paths>::operator(.....) { ... }

Again, I would like to see some more samples or additional sections in the
How to? document.

> The argument and the body should be the same as for
> include_path::validate. Or
> you could just forward to that member function.
> As for 'parameter' -- it was function in the revieved
> version. It's now called
> 'value' and does not take the "name" argument.

Thanks for your explanations. It seems, that Wave works now with the new po
version. I'll chack it in after some additional tests really soon.

New questions/issues:
1. Why the new include files aren't included by the main program_options.hpp
2. program_options/config.hpp refers to BOOST_VERSION, shouldn't be
<boost/version.hpp> included as well?

Additionally I've attached some patches, which I had to apply to make the po
library compile with the VC7.1 while used with Wave.

Regards Hartmut

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