Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Program_options: Parsing arguments like "+a" possible?
From: boost_mailinglist_at_[hidden]
Date: 2011-08-09 07:27:05


Thank you for the good answer.

It gives me the chance to create a new list of Arguments, all with a
"-", without loosing the compatibly with the older "+" syntax.

Thanks

Am 08.08.2011 14:20, schrieb Diederick C. Niehorster:
> I'm not sure, if it seems easy for you, go for it!
>
> But have a look at this:
> http://www.boost.org/doc/libs/1_47_0/doc/html/program_options/howto.html#id2192951
>
> It might do the trick for you already, if you can change the plus into
> some prefix or suffix that distinguishes it fomr the minus.
>
> Best,
> Dee
>
> On Mon, Aug 8, 2011 at 19:36,<boost_mailinglist_at_[hidden]> wrote:
>> Hey,
>>
>> do you think to create a own parser based on boost.qi is the best solution?
>>
>> Thanks
>>
>> Am 08.08.2011 13:15, schrieb Diederick C. Niehorster:
>>>
>>> You'll have to read through the source code (which isn't straight
>>> forward). There will be a parser somewhere (maybe its easiest to find
>>> the right file by putting a breakpoint before a call to
>>> program_options and stepping through till you're in the parser. Once
>>> there, the change is probably pretty trivial. And if you can do it in
>>> a nice configurable way with a user exposed setting, the maintainers
>>> might accept a patch. Though I'm worried about how you are going to
>>> internally distinguish the + and - options...
>>>
>>> Best,
>>> Dee
>>>
>>> On Mon, Aug 8, 2011 at 19:10,<boost_mailinglist_at_[hidden]> wrote:
>>>>
>>>> Am 08.08.2011 12:52, schrieb Leo Cacciari:
>>>>>
>>>>> Il 08/08/2011 12:47 PM, boost_mailinglist_at_[hidden] ha scritto:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> the app is grown up step by step and a other person has taken the
>>>>>> decission to use the "+" as a sign for an argument. (All the letters
>>>>>> for
>>>>>> the - are used.)
>>>>>> My task is more or less to rewrite the old case() parser to a new one,
>>>>>> possible based on boost.program_options, to get a clear structure. At
>>>>>> the moment I'm not very interesting to change the argument style,
>>>>>> because all the example and more has also to be change to the new
>>>>>> style.
>>>>>>
>>>>> Well then I believe you're out of luck. AFAIK and as is stated in the
>>>>> library documentation, start character for short options is - or / (the
>>>>> latter to conform to windows usage).
>>>>>
>>>> Is there a way to get the library "patched" and replace the / through +?
>>>> The app will only be used under linux.
>>>>
>>>> Thanks
>>>> _______________________________________________
>>>> Boost-users mailing list
>>>> Boost-users_at_[hidden]
>>>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>>>
>>> _______________________________________________
>>> Boost-users mailing list
>>> Boost-users_at_[hidden]
>>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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