Boost logo

Boost Users :

Subject: Re: [Boost-users] program_option parsing error
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-09-24 05:13:56


Hi Marek,

On 23-Sep-15 4:41 PM, Marek Skalický wrote:
> Hello everyone,
> I have a question about program_option library.
>
> If I have argv=["binaryname", "--port", "5"] and port have set
> default_value=6 and implicit_value=7 what should be the value of port
> after parsing argv?

It should be 5.

default_value does not matter because the --port option is provided
implicit_value does not matter because the --port option includes a value explicitly

> I am asking because this test
> https://github.com/mongodb/mongo/blob/0481c958daeb2969800511e7475dc66986fa9ed5/src/mongo/util/options_parser/options_parser_test.cpp#L753 is failing with boost 1.59 (with boost 1.58 it is passing). Does someone please know what changed in this new version?

Does this issue reproduces when using program_options directly? The code above appears to use classes that are
similar, but not the same.

Thanks,
Volodya


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