diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-10-10 16:50:28 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2013-10-11 15:01:24 -0400 |
commit | 39c6861e3a012cd6cc2148cd961be9cb7502ac3e (patch) | |
tree | dbb87a20611c0b5242e0af72a8d6ebe08e3ca36c /src/mongo/db/mongod_options.cpp | |
parent | ef132b3aa10765022cb9c1e23f3d91025094848d (diff) | |
download | mongo-39c6861e3a012cd6cc2148cd961be9cb7502ac3e.tar.gz |
SERVER-8510 Consolidate option parsing into the parser so parsing is implied by linking the parser
Diffstat (limited to 'src/mongo/db/mongod_options.cpp')
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 5353845040e..b13621ba69c 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -41,10 +41,8 @@ #include "mongo/db/server_options.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/net/ssl_options.h" -#include "mongo/util/options_parser/option_description.h" -#include "mongo/util/options_parser/option_section.h" -#include "mongo/util/options_parser/options_parser.h" #include "mongo/util/options_parser/startup_option_init.h" +#include "mongo/util/options_parser/startup_options.h" #include "mongo/util/version.h" namespace mongo { @@ -414,7 +412,7 @@ namespace mongo { Status handlePreValidationMongodOptions(const moe::Environment& params, const std::vector<std::string>& args) { if (params.count("help")) { - printMongodHelp(serverOptions); + printMongodHelp(moe::startupOptions); ::_exit(EXIT_SUCCESS); } if (params.count("version")) { @@ -777,28 +775,15 @@ namespace mongo { } MONGO_GENERAL_STARTUP_OPTIONS_REGISTER(MongodOptions)(InitializerContext* context) { - return addMongodOptions(&serverOptions); - } - - MONGO_STARTUP_OPTIONS_PARSE(MongodOptions)(InitializerContext* context) { - moe::OptionsParser parser; - Status ret = parser.run(serverOptions, context->args(), context->env(), - &serverParsedOptions); - if (!ret.isOK()) { - std::cerr << ret.reason() << std::endl; - std::cerr << "try '" << context->args()[0] - << " --help' for more information" << std::endl; - ::_exit(EXIT_BADOPTIONS); - } - return Status::OK(); + return addMongodOptions(&moe::startupOptions); } MONGO_STARTUP_OPTIONS_VALIDATE(MongodOptions)(InitializerContext* context) { - Status ret = handlePreValidationMongodOptions(serverParsedOptions, context->args()); + Status ret = handlePreValidationMongodOptions(moe::startupOptionsParsed, context->args()); if (!ret.isOK()) { return ret; } - ret = serverParsedOptions.validate(); + ret = moe::startupOptionsParsed.validate(); if (!ret.isOK()) { return ret; } @@ -811,7 +796,7 @@ namespace mongo { // getGlobalAuthorizationManager(). ("EndStartupOptionStorage")) (InitializerContext* context) { - return storeMongodOptions(serverParsedOptions, context->args()); + return storeMongodOptions(moe::startupOptionsParsed, context->args()); } } // namespace mongo |