|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65645 - trunk/libs/program_options/src
From: ghost_at_[hidden]
Date: 2010-09-28 05:04:46
Author: vladimir_prus
Date: 2010-09-28 05:04:44 EDT (Tue, 28 Sep 2010)
New Revision: 65645
URL: http://svn.boost.org/trac/boost/changeset/65645
Log:
Fix formatting of short-only options.
Fixes #4644.
Text files modified:
trunk/libs/program_options/src/options_description.cpp | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
Modified: trunk/libs/program_options/src/options_description.cpp
==============================================================================
--- trunk/libs/program_options/src/options_description.cpp (original)
+++ trunk/libs/program_options/src/options_description.cpp 2010-09-28 05:04:44 EDT (Tue, 28 Sep 2010)
@@ -174,10 +174,13 @@
option_description::format_name() const
{
if (!m_short_name.empty())
- return string(m_short_name).append(" [ --").
- append(m_long_name).append(" ]");
- else
- return string("--").append(m_long_name);
+ {
+ return m_long_name.empty()
+ ? m_short_name
+ : string(m_short_name).append(" [ --").
+ append(m_long_name).append(" ]");
+ }
+ return string("--").append(m_long_name);
}
std::string
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk