|
Boost : |
Subject: [boost] [program_options] Formatting; split at space
From: Chard (boost_at_[hidden])
Date: 2009-11-30 11:03:46
Function: format_paragraph
File: options_description.cpp, line 423:
if (last_space != line_begin)
{
// is last_space within the second half ot the
// current line
if ((unsigned)distance(last_space, line_end) <
(line_length - indent) / 2) // "- indent" ?
{
line_end = last_space;
}
}
I'm given to understand that the code around here is designed to split the
description at a space, iff the space occurs at least half-way through the
description text.
The code currently subtracts the indent from the line_length, where the
line_length (within format_paragraph) represents the space available for the
description (indent has already been subtracted from line_length at the
beginning of format_paragraph).
The result is that the longer the option names, the less chance of the split
occurring at a space within the description. Was this the intention?
E.g. if an option is 40 chars long, then there is no chance of it splitting at
a space (for 80 column default).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk