Ticket #3703 (closed Feature Requests: fixed)
Request for ability to specify description column width
|Reported by:||Chard||Owned by:||s_ochsenknecht|
|Keywords:||description column formatting||Cc:||s.ochsenknecht@…|
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).
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?)
- Owner changed from vladimir_prus to s_ochsenknecht
- Status changed from new to assigned
- Status changed from assigned to closed
- Resolution set to fixed