Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-07-18 16:34:43


Bryan Green wrote:

> Vladimir Prus writes:
>>
>> Speaking about -v -v -v, there's no stock way to achieve that. However,
>> the provided interfaces seem to make it possible:
>>
>> 1. Derive from value_semantics.
>>
>> 2. Define the 'parse' method to add one to already stored value.
>
> Thanks for the suggestion - I will give it a try!
>
>> If you're volunteering, you're most welcome.
>
> Well, I'd really like to be able to get the functionality of GNU
> getopt_long's 'optional_argument' feature. Do you have any sense of the
> feasability of that? If it seems feasable, I might be able to take a
> crack at it.

I assume you mean that, for example

        --foobar=10

explicitly provides a value of 'foobar', and

        --foobar

provides some default value of 'foobar'. Something like that was actually
supported, but it was somewhat messy. First of all, it requires
two default values -- default value if the option is not provided at
all, and value that is used when the option is provided, but without any
explicit value. This is already nasty interface. Further, given

        --foo -1

what is '-1'? Is it value to '--foo'? Or is it separate option? So,
I decided that optional options are not really needed. I'm open
to other opinions, but there should be some nice solution to the above
problems.

- 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