mirror of
https://github.com/boostorg/program_options.git
synced 2026-01-20 16:52:14 +00:00
Compare commits
3 Commits
pr/excepti
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4374acd557 | ||
|
|
3f14d81e7b | ||
|
|
f82880013b |
@@ -290,8 +290,8 @@ namespace boost { namespace program_options { namespace detail {
|
||||
|
||||
// First check that the option is valid, and get its description.
|
||||
// TODO: case-sensitivity.
|
||||
const option_description* xd =
|
||||
m_desc->find_nothrow(opt.string_key, (m_style & allow_guessing));
|
||||
const option_description* xd = m_desc->find_nothrow(opt.string_key,
|
||||
(m_style & allow_guessing) ? true : false);
|
||||
|
||||
if (!xd)
|
||||
{
|
||||
@@ -470,7 +470,8 @@ namespace boost { namespace program_options { namespace detail {
|
||||
((m_style & allow_slash_for_short) && tok[0] == '/')))
|
||||
{
|
||||
if (m_desc->find_nothrow(tok.substr(1, tok.find('=')-1),
|
||||
m_style & allow_guessing)) {
|
||||
(m_style & allow_guessing) ? true : false))
|
||||
{
|
||||
args[0].insert(0, "-");
|
||||
if (args[0][1] == '/')
|
||||
args[0][1] = '-';
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace boost { namespace program_options {
|
||||
return m_options;
|
||||
}
|
||||
|
||||
const option_description*
|
||||
const option_description*
|
||||
options_description::find_nothrow(const std::string& name,
|
||||
bool approx) const
|
||||
{
|
||||
@@ -279,10 +279,10 @@ namespace boost { namespace program_options {
|
||||
//
|
||||
// For now, we don't check the situation when there are
|
||||
// two full matches.
|
||||
|
||||
|
||||
if (r == option_description::full_match)
|
||||
{
|
||||
return m_options[i].get();
|
||||
return m_options[i].get();
|
||||
}
|
||||
|
||||
found = m_options[i];
|
||||
@@ -293,8 +293,8 @@ namespace boost { namespace program_options {
|
||||
if (approximate_matches.size() > 1)
|
||||
boost::throw_exception(
|
||||
ambiguous_option(name, approximate_matches));
|
||||
else
|
||||
return found.get();
|
||||
|
||||
return found.get();
|
||||
}
|
||||
|
||||
BOOST_PROGRAM_OPTIONS_DECL
|
||||
@@ -408,7 +408,7 @@ namespace boost { namespace program_options {
|
||||
{
|
||||
// is last_space within the second half ot the
|
||||
// current line
|
||||
if (unsigned(distance(last_space, line_end)) <
|
||||
if ((unsigned)distance(last_space, line_end) <
|
||||
(line_length - indent) / 2)
|
||||
{
|
||||
line_end = last_space;
|
||||
|
||||
Reference in New Issue
Block a user