File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
include/boost/program_options Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ options_description desc;
181
181
desc.add_options()
182
182
("help", "produce help message")
183
183
("compression", value< string> (), "compression level")
184
- ("verbose", value< string> ()->zero_tokens( ), "verbosity level")
184
+ ("verbose", value< string> ()->implicit_value("0" ), "verbosity level")
185
185
("email", value< string> ()->multitoken(), "email to send to")
186
186
;
187
187
</programlisting >
Original file line number Diff line number Diff line change @@ -261,13 +261,21 @@ namespace boost { namespace program_options {
261
261
return this ;
262
262
}
263
263
264
- /* * Specifies that the value can span multiple tokens. */
264
+ /* * Specifies that the value can span multiple tokens.
265
+ */
265
266
typed_value* multitoken ()
266
267
{
267
268
m_multitoken = true ;
268
269
return this ;
269
270
}
270
271
272
+ /* * Specifies that no tokens may be provided as the value of
273
+ this option, which means that only presense of the option
274
+ is significant. For such option to be useful, either the
275
+ 'validate' function should be specialized, or the
276
+ 'implicit_value' method should be also used. In most
277
+ cases, you can use the 'bool_switch' function instead of
278
+ using this method. */
271
279
typed_value* zero_tokens ()
272
280
{
273
281
m_zero_tokens = true ;
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ namespace boost { namespace program_options { namespace detail {
277
277
}
278
278
279
279
/* If an key option is followed by a positional option,
280
- can can consume more tokens (e.g. it's multitoke option),
280
+ can can consume more tokens (e.g. it's multitoken option),
281
281
give those tokens to it. */
282
282
vector<option> result2;
283
283
for (unsigned i = 0 ; i < result.size (); ++i)
You can’t perform that action at this time.
0 commit comments