Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-03-24 03:32:19


Vladimir Prus wrote:

> The first post-review version of the program_options library
> is now available.
> I believe that all important interface changes are finished
> and would like to ask for feedback on the current version,
> before I go on.
>
> Some of the interesting changes include:
>
> - better way to describe option values
> - support for positional options
> - support for environment variables
>
> The library and documentation can be obtained at
>
> http://zigzag.cs.msu.su:7813/program_options
>
> The documentation can also be browsed online at
>
> http://zigzag.cs.msu.su:7813/program_options/html
>
> And the source can also be browsed online at
>
> http://zigzag.cs.msu.su:7813/repos/trunk/program_options
>
> Since the interface has changes quite a bit, the brief list
> of changes is included in docs, to help with migration. See
>
> http://zigzag.cs.msu.su:7813/program_options/html/ch01s04.html
>
> All comments are very appreciated.

In addition to the mentioned interface changes I've stumbled over the
following issues/incompatibilities with the reviewed version:

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:

parsers.hpp(102):
    /** Creates instance of 'command_line_parser', passes a vector
containing
        the arguments to it, and returns the result of calling the 'run'
method.
     */
    parsed_options
    parse_command_line(std::vector<std::string> &args,
                       const options_description& desc, int style = 0,
                       function1<std::pair<std::string, std::string>, const
std::string&> ext
                       = ext_parser());

parsers.cpp(180):
    parsed_options
    parse_command_line(std::vector<std::string> &args,
                       const options_description& desc, int style,
                       function1<std::pair<string, string>, const string&>
ext)
    {
        return command_line_parser(args).options(desc).style(style).
        extra_parser(ext).run();
    }

2. The examples doesn't seem to be updated to the new po interface (at least
the real.cpp and regex.cpp examples)

3. As I've already pointed out, it is very important (at least for me, but I
assume for others using older versions of the library too) to have some
means of getting the version of the po library. I suggest adding:

    #define BOOST_PROGRAM_OPTIONS_VERSION 0x0200

to the program_options.hpp file, or to a separate file, which is included by
all the other po headers.

4. Now, that the options_and_arguments class has gone, is there a means of
getting access to the arguments given on a command line (I mean all the
remaining stuff, which isn't recognized as a valid option/parameter)? I
can't find any documentation on this topic and wasn't able to find anything
related browing through the sources.

5. In the file overview.xml in the code box under the Storage component
heading the argument sequence for the store() function doesn't match the
corresponding documentation/code.

6. I find it very hmmm distracting, that the syntax of the add_options()
construct has changed significantly! Isn't there any way to make it more
compatible with the syntax used in the reviewed version? The only way I see
now is to include two versions of the add_options() code into my application
(Wave), which is very ugly! Or, I have to abandon the support for the
'older' syntax, but this puts additional burden onto the users of Wave,
because they will have to keep track of the version of the po library 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.

7. What's the equivalent for the parameter and validator classes, which were
contained in the reviewed version?

Regards Hartmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk