mirror of
https://github.com/boostorg/program_options.git
synced 2026-01-19 04:22:15 +00:00
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user