[Boost-bugs] [Boost C++ Libraries] #4541: Options starting with "opt_" not recognized by command line parser

Subject: [Boost-bugs] [Boost C++ Libraries] #4541: Options starting with "opt_" not recognized by command line parser
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-14 17:06:35


#4541: Options starting with "opt_" not recognized by command line parser
---------------------------------------------------+------------------------
 Reporter: Peter Hepperger <hepperger@…> | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: | Component: program_options
  Version: Boost 1.43.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 Hello,

 I have a strange problem when using boost::program_options. Options whose
 name starts with "opt_" seem to be ignored by the command line parser. I
 tried to declare an option of type string with name "opt_method". If I
 enter the command line parameter --opt_method='foo', the option value
 'foo' is not present afterwards (the value is still equal to the default
 value, if any is declared). The parameter is read correctly when using a
 configuration file, however.

 Moreover, if I do NOT declare an option with this name, but still enter
 the command line parameter, there is no
 boost::program_options::unknown_option exception thrown. As soon as I
 change the name of the option to "optmethod" or "method", the problems are
 gone.

 Best regards,
 Peter

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