[Boost-bugs] [Boost C++ Libraries] #3703: Request for ability to specify description column width

Subject: [Boost-bugs] [Boost C++ Libraries] #3703: Request for ability to specify description column width
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-01 10:24:03


#3703: Request for ability to specify description column width
-------------------------------------------+--------------------------------
 Reporter: Chard | Owner: vladimir_prus
     Type: Feature Requests | Status: new
Milestone: Boost 1.42.0 | Component: program_options
  Version: Boost 1.41.0 | Severity: Problem
 Keywords: description column formatting |
-------------------------------------------+--------------------------------
 I see that the version of options_description.cpp on the trunk has been
 modified to address the issue where long options cause the description
 text to be bunched up on the right.

 The trunk version is using the (sensible assumption) of the (line_length /
 2) as the threshold.

 This is a request to expose this ''threshold'' position by providing
 another constructor (or mutator); the programmer may want a different
 ratio between the option:description columns.

 Patches are included that demonstrate one possible approach (using another
 constructor).

 Notes:

 The original constructors were modified to use the (line_length / 2)
 threshold. It could be argued that the default should be 1; to preserve
 current (1.41) display behaviour.

 The original code has a constant of 23 in the code, for the minimum
 description column start position. In the patch this ''wins'' even if the
 min_description_length would encroach into this area. I wasn't sure
 whether this should be asserted in the constructor, i.e.
 assert(min_description_length < m_lineLength - (23U + 1U)).

 There is also an options_description_test.cpp patch to demonstrate the
 behaviour.

 (Also: are you aware that test_long_default_value() asserts?)

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