Works like a charm. Thanks!

Kobi.

On 5/12/06, François Duranleau <duranlef@iro.umontreal.ca> wrote:
On Fri, 12 May 2006, Kobi Cohen-Arazi wrote:

> Hi,
>
> boost-1.32.0-6
>
> I've tried to find in the program_options docs how to specify a regular
> boolean switch. If I use <bool>, it still demand putting something
>
> That's what I would like to have
> ./prog -t
>
> and not
> ./prog -t1
>
> Right now, when using <bool> it will throw an exception if I'm not using the
> -t1 notation.
>
> Am I missing here something?

Use zero_tokens(), e.g.:

namespace po = ::boost::program_options ;

bool the_flag ;

po::options_description opts( "Options" ) ;

opts.add_options()( "the-flag,t" , po::value( &the_flag )->zero_tokens() )
     //...
     ;

--
François Duranleau
LIGUM, Université de Montréal

"There are as many truths as there are people."
                                           - from _Neon Genesis Evangelion_

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users