Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-04-29 00:55:56


Thomas Dilling wrote:

>> Doug, what's your opinion about my fixing the problem, despite feature
>> freeze? Basically, there's public interface function that does not work
>> at all, so it can be considered as bugfix, not as a new feature.
>>
>> - Volodya
>
> Hi Volodya,
> is it possible to get a list of unrecognized options.
> I have to forward this options to another library.

I'm still waiting for Doug to comment on my committing this feature. What I
plan is that the 'option' class will get two additional members. First is
'bool unknown'. So, you'll be able to walk the vector of option and pick
option that have this member set to 'true'.

The other new member will be 'vector<string> original_tokens;'. The standard
parser will set it to the command line tokens parsed to form the option. It
can be used to reconstruct back the unrecognized elements of command line.

So, if you pass

  --foo 10 --bar=12

and no options is registered, you'll get vector of three options.

1. "foo", with no value, and "original_tokens" set to "--foo"
2. 10, which will be marked as positional
3. "bar" with value "12", and "original_tokens" set to "--bar=12"

All of them will be 'unknown' flag set. So, you can both pass the
unrecognized options to another library, or reconstruct the command line
for unrecognized options.

Will that be OK for you?

- Volodya

> Regards,
> Thomas
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk