|
Boost Users : |
Subject: Re: [Boost-users] [Program Options] terminate parsing after first positional argument
From: Evan Driscoll (driscoll_at_[hidden])
Date: 2012-07-05 19:54:19
On 07/05/2012 06:07 PM, Evan Driscoll wrote:
> On 01/-10/-28163 01:59 PM, Vladimir Prus wrote:
>> that patch of yours looks perfectly reasonable to me. It would seem that
>> a style option, e.g. 'allow_intermixed' can be used to control
>> this behaviour (with the current behaviour as default).
>
> Can I just run the plan by you then?
OK, this is not as clear as I was thinking. (Surprise surprise!)
As phrased, this is a backwards-incompatible change. If a client of the
library builds their own style_t value from scratch (as opposed to
starting from default_style and setting/unsetting bits in that), they'll
not set allow_interspersed, and lose interspersed arguments.
This was illustrated by the fact that I had to modify three style_t
declarations in cmdline_test.cpp to fix test cases that I broke. (Lines
368, 397, and 412 or thereabouts.) If I just pass a literal false as in
my original patch, everything is peachy in the unmodified test cases.
(I'm not sure I understand why the test cases were failing, but that's
probably just because I don't have a holistic enough view of how the
test cases are written.)
How should I handle this? Cleanest way I can think of that doesn't break
compatibility is to add a 'allow_interspersed' style option instead with
the opposite sense, but everything else is 'allow_*'.
Evan
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