diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-10-23 22:07:16 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2013-10-23 22:10:07 -0400 |
commit | d431dc6ca4b15bed750463fccd334d3b681da73e (patch) | |
tree | 60835cff1cf78c56ddf8d75c75eb4033a43e7788 | |
parent | 1a58dde196331e0719ffe36a398f5ab8a93cbad5 (diff) | |
download | mongo-d431dc6ca4b15bed750463fccd334d3b681da73e.tar.gz |
SERVER-11144 Fix check for positional option in a sub section
-rw-r--r-- | src/mongo/util/options_parser/option_section.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp index 94fac882e2c..6a7f8c268f2 100644 --- a/src/mongo/util/options_parser/option_section.cpp +++ b/src/mongo/util/options_parser/option_section.cpp @@ -29,11 +29,13 @@ namespace optionenvironment { // TODO: Make sure the section we are adding does not have duplicate options Status OptionSection::addSection(const OptionSection& subSection) { std::list<OptionDescription>::const_iterator oditerator; - for (oditerator = _options.begin(); - oditerator != _options.end(); oditerator++) { + for (oditerator = subSection._options.begin(); + oditerator != subSection._options.end(); oditerator++) { if (oditerator->_positionalStart != -1) { - return Status(ErrorCodes::InternalError, - "Attempted to add subsection with positional options"); + StringBuilder sb; + sb << "Attempted to add subsection with positional option: " + << oditerator->_dottedName; + return Status(ErrorCodes::InternalError, sb.str()); } } _subSections.push_back(subSection); |