@@ -434,9 +434,6 @@ namespace boost { namespace program_options { namespace detail {
434434 // (the value in --foo=1) counts as a separate token, and if present
435435 // must be consumed. The following tokens on the command line may be
436436 // left unconsumed.
437-
438- // We don't check if those tokens look like option, or not!
439-
440437 unsigned min_tokens = d.semantic ()->min_tokens ();
441438 unsigned max_tokens = d.semantic ()->max_tokens ();
442439
@@ -450,9 +447,8 @@ namespace boost { namespace program_options { namespace detail {
450447 invalid_command_line_syntax (invalid_command_line_syntax::extra_parameter));
451448 }
452449
453- // If an option wants, at minimum, N tokens, we grab them there,
454- // when adding these tokens as values to current option we check
455- // if they look like options
450+ // Grab min_tokens values from other_tokens, but only if those tokens
451+ // are not recognized as options themselves.
456452 if (opt.value .size () <= min_tokens)
457453 {
458454 min_tokens -= static_cast <unsigned >(opt.value .size ());
@@ -462,7 +458,7 @@ namespace boost { namespace program_options { namespace detail {
462458 min_tokens = 0 ;
463459 }
464460
465- // Everything's OK, move the values to the result.
461+ // Everything's OK, move the values to the result.
466462 for (;!other_tokens.empty () && min_tokens--; )
467463 {
468464 // check if extra parameter looks like a known option
0 commit comments