summaryrefslogtreecommitdiff
path: root/src/mongo/util
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2019-07-02 15:37:23 +0000
committerSara Golemon <sara.golemon@mongodb.com>2019-07-03 20:20:02 +0000
commitf8cdf774a81b3af8825ac76eaebef1fd48183b5a (patch)
tree11f658690c81c7f946748c068717e97c52781ff8 /src/mongo/util
parent8071e24f0f7a4fa83015daa59d828c11c246423c (diff)
downloadmongo-f8cdf774a81b3af8825ac76eaebef1fd48183b5a.tar.gz
SERVER-41903 Validate server parameter names during config validation
Diffstat (limited to 'src/mongo/util')
-rw-r--r--src/mongo/util/options_parser/options_parser_init.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/util/options_parser/options_parser_init.cpp b/src/mongo/util/options_parser/options_parser_init.cpp
index c484518ca3d..d6e20ffe045 100644
--- a/src/mongo/util/options_parser/options_parser_init.cpp
+++ b/src/mongo/util/options_parser/options_parser_init.cpp
@@ -40,6 +40,7 @@
namespace mongo {
namespace optionenvironment {
+namespace {
MONGO_STARTUP_OPTIONS_PARSE(StartupOptions)(InitializerContext* context) {
OptionsParser parser;
@@ -50,6 +51,14 @@ MONGO_STARTUP_OPTIONS_PARSE(StartupOptions)(InitializerContext* context) {
std::cerr << "try '" << context->args()[0] << " --help' for more information" << std::endl;
quickExit(EXIT_BADOPTIONS);
}
+
+ return Status::OK();
+}
+
+MONGO_INITIALIZER_GENERAL(OutputConfig,
+ ("EndStartupOptionValidation"),
+ ("BeginStartupOptionStorage"))
+(InitializerContext*) {
if (startupOptionsParsed.count("outputConfig")) {
bool output = false;
auto status = startupOptionsParsed.get(Key("outputConfig"), &output);
@@ -64,5 +73,6 @@ MONGO_STARTUP_OPTIONS_PARSE(StartupOptions)(InitializerContext* context) {
return Status::OK();
}
+} // namespace
} // namespace optionenvironment
} // namespace mongo