Clarify docs for 'zero_token'.

Fixes #1132.


[SVN r67774]
This commit is contained in:
Vladimir Prus
2011-01-08 11:45:50 +00:00
parent 825562ed1e
commit 7051655c76
3 changed files with 11 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ options_description desc;
desc.add_options()
("help", "produce help message")
("compression", value<string>(), "compression level")
("verbose", value<string>()->zero_tokens(), "verbosity level")
("verbose", value<string>()->implicit_value("0"), "verbosity level")
("email", value<string>()->multitoken(), "email to send to")
;
</programlisting>

View File

@@ -261,13 +261,21 @@ namespace boost { namespace program_options {
return this;
}
/** Specifies that the value can span multiple tokens. */
/** Specifies that the value can span multiple tokens.
*/
typed_value* multitoken()
{
m_multitoken = true;
return this;
}
/** Specifies that no tokens may be provided as the value of
this option, which means that only presense of the option
is significant. For such option to be useful, either the
'validate' function should be specialized, or the
'implicit_value' method should be also used. In most
cases, you can use the 'bool_switch' function instead of
using this method. */
typed_value* zero_tokens()
{
m_zero_tokens = true;

View File

@@ -277,7 +277,7 @@ namespace boost { namespace program_options { namespace detail {
}
/* If an key option is followed by a positional option,
can can consume more tokens (e.g. it's multitoke option),
can can consume more tokens (e.g. it's multitoken option),
give those tokens to it. */
vector<option> result2;
for (unsigned i = 0; i < result.size(); ++i)