summaryrefslogtreecommitdiff
path: root/src/mongo/util/options_parser/option_section.cpp
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@mongodb.com>2014-05-14 16:31:53 -0400
committerShaun Verch <shaun.verch@mongodb.com>2014-05-15 15:45:20 -0400
commit9628f0418502a97aff046e9ae28bebdab4d6b9cd (patch)
treeb7ca0f505857206761de813d9a43160274b483b0 /src/mongo/util/options_parser/option_section.cpp
parentbc9db9c8183917ffbc743424fb97297e9fa75643 (diff)
downloadmongo-9628f0418502a97aff046e9ae28bebdab4d6b9cd.tar.gz
SERVER-13439 Do not fall through Switch case to Bool case in options conversion
Diffstat (limited to 'src/mongo/util/options_parser/option_section.cpp')
-rw-r--r--src/mongo/util/options_parser/option_section.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp
index d3bacb04b95..fb19d1c926e 100644
--- a/src/mongo/util/options_parser/option_section.cpp
+++ b/src/mongo/util/options_parser/option_section.cpp
@@ -138,6 +138,12 @@ namespace optionenvironment {
*boostType = std::auto_ptr<po::value_semantic>(po::bool_switch());
return Status::OK();
}
+ else {
+ // Switches should be true if they are present with no explicit value.
+ *boostType = std::auto_ptr<po::typed_value<bool> >(po::value<bool>()
+ ->implicit_value(true));
+ return Status::OK();
+ }
}
case Bool:
{