Works like a charm. Thanks!<br><br>Kobi.<br><br><div><span class="gmail_quote">On 5/12/06, <b class="gmail_sendername">Fran�ois Duranleau</b> <<a href="mailto:duranlef@iro.umontreal.ca">duranlef@iro.umontreal.ca</a>> wrote: </span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Fri, 12 May 2006, Kobi Cohen-Arazi wrote:<br><br>> Hi,<br>><br>> boost-1.32.0-6 <br>><br>> I've tried to find in the program_options docs how to specify a regular<br>> boolean switch. If I use <bool>, it still demand putting something<br>><br>> That's what I would like to have<br> > ./prog -t<br>><br>> and not<br>> ./prog -t1<br>><br>> Right now, when using <bool> it will throw an exception if I'm not using the<br>> -t1 notation.<br>><br>> Am I missing here something? <br><br>Use zero_tokens(), e.g.:<br><br>namespace po = ::boost::program_options ;<br><br>bool the_flag ;<br><br>po::options_description opts( "Options" ) ;<br><br>opts.add_options()( "the-flag,t" , po::value( &the_flag )->zero_tokens() ) <br> //...<br> ;<br><br>--<br>Fran�ois Duranleau<br>LIGUM, Universit� de Montr�al<br><br>"There are as many truths as there are people."<br> - from _Neon Genesis Evangelion_ <br><br>_______________________________________________<br>Boost-users mailing list<br><a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br><a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users"> http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br><br>_______________________________________________<br>Boost-users mailing list<br><a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a> <br><a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users">http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br><br></blockquote></div><br>