Boost logo

Boost :

From: Jonathan Graehl (jonathan_at_[hidden])
Date: 2004-09-24 19:23:19


I grepped through the program_options source and couldn't find anything
about declaratively specifying required options (or even more
specifically, min/max # of occurrences), except for positional options.

I know it's possible to do variables_map::count("option-name") or if I
have an impossible default value bound to an option, I could check for
that (default would = option absence), but it might be nice to have
"requiredness" be a declared option trait, that could show up in the
option description.

value<int>(&myoption)->required()

or something like that - obviously min/max wouldn't make sense for
scalars (I have no use for min/max personally).

-Jonathan

p.s. I know there is a concept in the command line parser of "value
required or not" - I'm talking about an *option* being required.


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