Boost logo

Boost Users :

Subject: Re: [Boost-users] [Program_options] How to parse a command-line incrementally
From: Olaf Meeuwissen (olaf.meeuwissen_at_[hidden])
Date: 2012-02-15 20:06:22


Dmitriy Matison <matison.d_at_[hidden]> writes:

> Hi Olaf:
>
> On 15/02/2012, Olaf Meeuwissen <olaf.meeuwissen_at_[hidden]> wrote:
>> The parser should be incremental in the sense that parsing should stop
>> at the first unknown option or positional argument. At this point, my
>> program would pick the next options description and continue parsing
>> with that. This would proceed until the command-line has been parsed
>> completely or the program is no longer interested in the remainder.
>>
>
> It seems you can make your first positional option multi-token, it
> will read the rest of command line. And call special function when
> this positional has been passed, your processing will be done inside
> this function. That can be done using "notifier" method of your option
> semantic (class typed_value).

Thanks for the suggestion, I'll have a look. I hadn't thought of using
notifiers for this.

-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962

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