@@ -39,6 +39,11 @@ namespace boost { namespace program_options {
39
39
should be present on the command line. */
40
40
virtual unsigned max_tokens () const = 0;
41
41
42
+ /* * Returns true if the option should only take adjacent token,
43
+ not one from further command-line arguments.
44
+ */
45
+ virtual bool adjacent_tokens_only () const = 0;
46
+
42
47
/* * Returns true if values from different sources should be composed.
43
48
Otherwise, value from the first source is used and values from
44
49
other sources are discarded.
@@ -49,7 +54,7 @@ namespace boost { namespace program_options {
49
54
50
55
*/
51
56
virtual bool is_required () const = 0;
52
-
57
+
53
58
/* * Parses a group of tokens that specify a value of option.
54
59
Stores the result in 'value_store', using whatever representation
55
60
is desired. May be be called several times if value of the same
@@ -135,6 +140,7 @@ namespace boost { namespace program_options {
135
140
136
141
unsigned min_tokens () const ;
137
142
unsigned max_tokens () const ;
143
+ bool adjacent_tokens_only () const { return false ; }
138
144
139
145
bool is_composing () const { return false ; }
140
146
@@ -322,6 +328,8 @@ namespace boost { namespace program_options {
322
328
}
323
329
}
324
330
331
+ bool adjacent_tokens_only () const { return !m_implicit_value.empty (); }
332
+
325
333
bool is_required () const { return m_required; }
326
334
327
335
/* * Creates an instance of the 'validator' class and calls
0 commit comments