[Boost-bugs] [Boost C++ Libraries] #4510: [program_options]: implicit_value and positional options conflict

Subject: [Boost-bugs] [Boost C++ Libraries] #4510: [program_options]: implicit_value and positional options conflict
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-05 17:18:49


#4510: [program_options]: implicit_value and positional options conflict
----------------------------------------------+-----------------------------
 Reporter: Soren Soe <soren.soe@…> | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: program_options
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
----------------------------------------------+-----------------------------
 Hello,

 Thanks for a great library.
 I just updated to 1.43 and it appears options with implicit values no
 longer work if there are also positional options.


 In fact libs/src/program_options/example/options_description.cpp fails in
 1.43:

 {{{
 1.43% options_description --verbose foo
 in option 'verbose': invalid option value
 }}}

 In 1.38 this worked fine

 {{{
 1.38% options_description --verbose foo
 Input files are: foo
 Verbosity enabled. Level is 1
 Optimization level is 10
 Listen port is 0
 }}}

 I briefly looked at the library source code and see new code added in
 cmdline.cpp:

 {{{
  /* If an key option is followed by a positional option,
      can can consume more tokens (e.g. it's multitoke option),
     give those tokens to it. */
  ...
 }}}

 It seems that in order to make implicit options work in presence of
 positional options, the semantic()->max_tokens() function must return 0,
 that is, you can never specify a value for an implicit option. I don't
 know if this is desired, but it will work for me.

 Thank you,

 Soren Soe

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4510>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC