[Boost-bugs] [Boost C++ Libraries] #4040: Program Options has issues with options that support multiple tokens when using multiple parsers

Subject: [Boost-bugs] [Boost C++ Libraries] #4040: Program Options has issues with options that support multiple tokens when using multiple parsers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-24 18:23:46


#4040: Program Options has issues with options that support multiple tokens when
using multiple parsers
----------------------------------------------+-----------------------------
 Reporter: Devin Crumb <dcrumb@…> | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: program_options
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
----------------------------------------------+-----------------------------
 If you have an option that allows multiple tokens and give that option at
 both command line and config file, only the tokens listed on the command
 line are saved.

 I fixed this issue by changing:
 {{{
             // If option has final value, skip this assignment
             if (xm.m_final.count(name))
                 continue;

             const option_description& d = desc.find(name, false,
                                                       false, false);
 }}}
 to:
 {{{
             const option_description& d = desc.find(name, false,
                                                       false, false);

             // If option has final value, skip this assignment
             if ((xm.m_final.count(name)) && (d.semantic()->max_tokens() <=
 1))
                 continue;
 }}}

 in boost::program_options::store() function in the file
 boost/libs/program_options/src/variables_map.cpp.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4040>
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:02 UTC