Opened 13 years ago
#4040 new Bugs
Program Options has issues with options that support multiple tokens when using multiple parsers
| Reported by: | Owned by: | Vladimir Prus | |
|---|---|---|---|
| Milestone: | Boost 1.43.0 | Component: | program_options | 
| Version: | Boost 1.42.0 | Severity: | Problem | 
| Keywords: | Cc: | 
Description
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.
  Note:
 See   TracTickets
 for help on using tickets.
    