Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3703: Request for ability to specify description column width
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-03 10:05:49
#3703: Request for ability to specify description column width
-------------------------------+--------------------------------------------
Reporter: Chard | Owner: s_ochsenknecht
Type: Feature Requests | Status: closed
Milestone: Boost 1.42.0 | Component: program_options
Version: Boost 1.41.0 | Severity: Cosmetic
Resolution: fixed | Keywords: description column formatting
-------------------------------+--------------------------------------------
Comment(by Chard <boost@â¦>):
Hi Sascha
I've had a bit more of a look at the changes, and there's a couple of
points to note:
1. I had called the original description length variable:
{{{min_description_length}}}, this has been renamed to
{{{description_length}}}. The "{{{min_}}}" part does add some semantic
meaning to the usage because the length that is specified is not an
absolute.
For example, if the user specifies 10 as the description length, he may be
expecting the description column to occupy ''exactly'' 10 spaces. But the
available distance is still determined by the length of the option column,
as demonstrated by this test case:
{{{
{
options_description desc("",
options_description::m_default_line_length,
10U);
desc.add_options()
("lt-23-chars", new untyped_value(),
"this shows that more space is given to the description column
when possible")
;
stringstream ss;
ss << desc;
BOOST_CHECK_EQUAL(ss.str(),
//123456789_123456789_1234
" --lt-23-chars arg this shows that more space is given to
the description \n"
" column when possible\n");
}
}}}
2. By tying the default argument for the description length to
{{{(default_line_length / 2)}}} it does mean that existing code that
specifies the {{{line_length}}} argument will still compile, but with a
potentially different display. The minimum description width will still
be 40, regardless of the specified {{{line_length}}}. However, I suspect
this is a minor point because for most cases the output should look
''better''.
Regards,
Chard.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3703#comment:9> 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