Boost C++ Libraries: Ticket #1527: [program_options] Second (and subsequent) lines in tabbed text not aligned correctly https://svn.boost.org/trac10/ticket/1527 <p> When using the tab character to set an alignment for text output, the second (and subsequent) lines are not displayed at the correct position. </p> <p> It appears that the number of characters between the newline (\n) and tab (\t) are not accounted for. </p> <p> Example: </p> <pre class="wiki"> boost::program_options::options_description options("Options"); options.add_options() ("help", "help text") ("list", "a list:\n \t" "item1, item2, item3, item4, item5, item6, item7, item8, item9, " "item10, item11, item12, item13, item14, item15, item16, item17, item18") ; std::cout &lt;&lt; options &lt;&lt; std::endl; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1527 Trac 1.4.3 s.ochsenknecht@… Sun, 08 Nov 2009 10:25:17 GMT attachment set https://svn.boost.org/trac10/ticket/1527 https://svn.boost.org/trac10/ticket/1527 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket1527.patch</span> </li> </ul> <p> testcase </p> Ticket s.ochsenknecht@… Sun, 08 Nov 2009 10:27:36 GMT <link>https://svn.boost.org/trac10/ticket/1527#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1527#comment:1</guid> <description> <p> I cannot reproduce this with current trunk. I think the behaviour is correct. I get following output of the mentioned testcase: </p> <pre class="wiki"> --list arg a list: item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 </pre><p> I attached an enhancement for the test cases which checks the user case. </p> <p> Please comment. Thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 09 Nov 2009 15:57:52 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1527#comment:2 https://svn.boost.org/trac10/ticket/1527#comment:2 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57515" title="Test for \t-alignment of options descriptions. Fixes #1527. Patch ...">[57515]</a>) Test for \t-alignment of options descriptions. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1527" title="#1527: Bugs: [program_options] Second (and subsequent) lines in tabbed text not ... (closed: fixed)">#1527</a>. Patch from Sascha Ochsenknecht. </p> Ticket Vladimir Prus Mon, 09 Nov 2009 16:01:12 GMT <link>https://svn.boost.org/trac10/ticket/1527#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1527#comment:3</guid> <description> <p> Sascha, I have applied the patch, thanks! </p> <p> BTW, was there a specific reason you changed std::string to just string in a couple of places? Not that it matters much. </p> </description> <category>Ticket</category> </item> <item> <author>s.ochsenknecht@…</author> <pubDate>Mon, 09 Nov 2009 16:15:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1527#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1527#comment:4</guid> <description> <p> The source already had a "using namespace std;" and at some places were string's defined without "std::". So, I just wanted the source consistent without any redundancy. </p> <p> Thanks, Sascha </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Chard</dc:creator> <pubDate>Mon, 30 Nov 2009 12:37:14 GMT</pubDate> <title>status, version, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/1527#comment:5 https://svn.boost.org/trac10/ticket/1527#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.34.1</span> → <span class="trac-field-new">Boost 1.41.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.36.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> </ul> <p> Hi Volodya, </p> <p> The original issue is valid and still present. </p> <p> The responding poster has not actually copied the OP's code <em>exactly</em>. </p> <p> There should be <strong>six</strong> spaces between the newline (\n) and tab (\t). The patched test code only uses two. This affects the spacing enough to make it output correctly. </p> <p> Find attached a patch for the test file (as it appears on the trunk), which <em>does</em> cause the failure, and also a patch with the fix, which is a simple one-liner. </p> Ticket Chard Mon, 30 Nov 2009 12:38:11 GMT attachment set https://svn.boost.org/trac10/ticket/1527 https://svn.boost.org/trac10/ticket/1527 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">options_description_test.patch</span> </li> </ul> <p> patch for test </p> Ticket Chard Mon, 30 Nov 2009 12:38:48 GMT attachment set https://svn.boost.org/trac10/ticket/1527 https://svn.boost.org/trac10/ticket/1527 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">options_description.patch</span> </li> </ul> <p> patch for <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1527" title="#1527: Bugs: [program_options] Second (and subsequent) lines in tabbed text not ... (closed: fixed)">#1527</a> </p> Ticket Sascha Ochsenknecht Mon, 30 Nov 2009 13:38:03 GMT <link>https://svn.boost.org/trac10/ticket/1527#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1527#comment:6</guid> <description> <p> Hi, </p> <p> I just checked in the patch on trunk. It looks ok for me. I leave the Ticket open until Volodya reviewed it. </p> <p> Sorry for confusion! </p> <p> Thanks, </p> <ul><li>Sascha </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 30 Nov 2009 14:01:57 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1527#comment:7 https://svn.boost.org/trac10/ticket/1527#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Seems ok to me. I'm closing this issue. Thanks for the followup, Chard! </p> Ticket