rename description_length to min_description_length for better semantic

[SVN r58112]
This commit is contained in:
Sascha Ochsenknecht
2009-12-03 11:11:34 +00:00
parent 60966caa35
commit 263534a213
2 changed files with 10 additions and 10 deletions

View File

@@ -159,7 +159,7 @@ namespace program_options {
/** Creates the instance. */
options_description(unsigned line_length = m_default_line_length,
unsigned description_length = m_default_line_length / 2);
unsigned min_description_length = m_default_line_length / 2);
/** Creates the instance. The 'caption' parameter gives the name of
this 'options_description' instance. Primarily useful for output.
The 'description_length' specifies the number of columns that
@@ -169,7 +169,7 @@ namespace program_options {
*/
options_description(const std::string& caption,
unsigned line_length = m_default_line_length,
unsigned description_length = m_default_line_length / 2);
unsigned min_description_length = m_default_line_length / 2);
/** Adds new variable description. Throws duplicate_variable_error if
either short or long name matches that of already present one.
*/
@@ -219,7 +219,7 @@ namespace program_options {
std::string m_caption;
const unsigned m_line_length;
const unsigned m_description_length;
const unsigned m_min_description_length;
// Data organization is chosen because:
// - there could be two names for one option

View File

@@ -206,23 +206,23 @@ namespace boost { namespace program_options {
const unsigned options_description::m_default_line_length = 80;
options_description::options_description(unsigned line_length,
unsigned description_length)
unsigned min_description_length)
: m_line_length(line_length)
, m_description_length(description_length)
, m_min_description_length(min_description_length)
{
// we require a space between the option and description parts, so add 1.
assert(m_description_length < m_line_length - 1);
assert(m_min_description_length < m_line_length - 1);
}
options_description::options_description(const std::string& caption,
unsigned line_length,
unsigned description_length)
unsigned min_description_length)
: m_caption(caption)
, m_line_length(line_length)
, m_description_length(description_length)
, m_min_description_length(min_description_length)
{
// we require a space between the option and description parts, so add 1.
assert(m_description_length < m_line_length - 1);
assert(m_min_description_length < m_line_length - 1);
}
void
@@ -554,7 +554,7 @@ namespace boost { namespace program_options {
}
/* this is the column were description should start, if first
column is longer, we go to a new line */
const unsigned start_of_description_column = m_line_length - m_description_length;
const unsigned start_of_description_column = m_line_length - m_min_description_length;
width = (min)(width, start_of_description_column-1);