Boost C++ Libraries: Ticket #3775: collect_unrecognized cannot find unrecognized options from parse_config_file https://svn.boost.org/trac10/ticket/3775 <p> program_options::collect_unrecognized does not properly collect unregistered options parsed via parse_config_file when parse_config_file is set to accept unregistered options. </p> <p> Test case attached as test.cpp. </p> <p> Compare the number of options that have unregistered == true vs the number of elements in recognized. I expect that the number of unregistered options is identical to the number of unrecognized options collected based upon <a href="http://www.boost.org/doc/libs/1_40_0/doc/html/boost/program_options/collect_unrecognized.html">the documentation</a>. </p> <p> It looks like parse_config_file fails to set basic_option&lt;charT&gt;.original_tokens correctly, and collect_unrecognized seems to rely on the original_tokens to do its job. The trouble involves boost/program_options/detail/parsers.hpp:135 where the std::copy call is a NOP but should not be. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3775 Trac 1.4.3 Rhys Ulerich <rhys.ulerich@…> Thu, 17 Dec 2009 21:13:28 GMT attachment set https://svn.boost.org/trac10/ticket/3775 https://svn.boost.org/trac10/ticket/3775 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> <p> Recreate demonstrating the problem and showing original_tokens being incorrect </p> Ticket Vladimir Prus Fri, 18 Dec 2009 06:37:58 GMT <link>https://svn.boost.org/trac10/ticket/3775#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3775#comment:1</guid> <description> <p> In trunk, your test program produces the following output: </p> <pre class="wiki">Unregistered options parsed... unknown_option: unknown_option something_unknown Unrecognized options collected... unknown_option something_unknown </pre><p> and the exit code is 0. IIRC, Sascha has modified config file parser to set original_tokens. </p> <p> So, shall I close this as fixed, or there's something else? </p> <p> Thanks, Volodya </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sascha Ochsenknecht</dc:creator> <pubDate>Fri, 18 Dec 2009 07:27:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3775#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3775#comment:2</guid> <description> <p> Yes, I checked in something. I think this is a duplicate to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2727" title="#2727: Bugs: program_options ill behaviour with unrecognized options (closed: fixed)">#2727</a>. </p> <p> Cheers, Sascha </p> </description> <category>Ticket</category> </item> <item> <author>Rhys Ulerich <rhys.ulerich@…></author> <pubDate>Fri, 18 Dec 2009 16:32:47 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3775#comment:3 https://svn.boost.org/trac10/ticket/3775#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Sorry guys for filing the dup. </p> Ticket