Boost logo

Boost Users :

Subject: Re: [Boost-users] [Program Options] terminate parsing after first positional argument
From: Evan Driscoll (driscoll_at_[hidden])
Date: 2012-07-05 20:25:46


One more post to this thread for now then I'm done for a bit. :-)

I implemented both versions (allow_interspersed and
disallow_interspersed) with a test. Patches for each are now up at the
issue tracker.
   https://svn.boost.org/trac/boost/ticket/6991

Evan

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? Actually looks even a little
> simpler than I was thinking. The docs don't discuss the style options
> really. Filenames are relative to the program_options directories:
>
> - cmdline.hpp
>
> Add a new value to 'enum style_t'. (I'll use 'allow_interspersed'
> if there's no objection)
>
> - src/cmdline.cpp and details/cmdline.hpp
>
> Take my patch from before and change "false /* or true for the
> behavior I want */" to "m_style & allow_interspersed"
>
>
> Then how do I use it? Do something like
>
> command_line_parser(argc, argv)
> .style(default_style | allow_interspersed)
> .run()
> ?
>
>
> Evan
>
>
>> As for testing,
>> you can add a new function to tests/positional_options_test.cpp,
>> and call it from main. The structure of existing tests should be
>> straightfoward.
>>
>> For avoidance of doubt, if you come up with a patch along these lines,
>> I'll be happy to commit it.
>>
>> 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