summaryrefslogtreecommitdiff
path: root/src/mongo/embedded/embedded_options.cpp
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2019-02-21 18:39:30 +0000
committerSara Golemon <sara.golemon@mongodb.com>2019-02-22 19:07:37 +0000
commitf78470edc935205c9d5b5c5253ff210d6f4471d3 (patch)
treebfbe14086c773b62dcbaad7d2c156b93edc7a486 /src/mongo/embedded/embedded_options.cpp
parentbd5bd0eff3fc852d55760ebb4c7ac62e394e8ce6 (diff)
downloadmongo-f78470edc935205c9d5b5c5253ff210d6f4471d3.tar.gz
SERVER-39724 Migrate embedded options to IDL
Diffstat (limited to 'src/mongo/embedded/embedded_options.cpp')
-rw-r--r--src/mongo/embedded/embedded_options.cpp45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/mongo/embedded/embedded_options.cpp b/src/mongo/embedded/embedded_options.cpp
index 8ba787b2bfd..522dea25616 100644
--- a/src/mongo/embedded/embedded_options.cpp
+++ b/src/mongo/embedded/embedded_options.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/server_options_base.h"
#include "mongo/db/server_options_helpers.h"
#include "mongo/db/storage/storage_options.h"
+#include "mongo/embedded/embedded_options_gen.h"
#include <boost/filesystem.hpp>
#include <string>
@@ -49,34 +50,7 @@ Status addOptions(optionenvironment::OptionSection* options) {
return ret;
}
- moe::OptionSection storage_options("Storage options");
-
- storage_options
- .addOptionChaining(
- "storage.engine", "storageEngine", moe::String, "what storage engine to use")
- .setDefault(optionenvironment::Value("mobile"));
-
-#ifdef _WIN32
- boost::filesystem::path currentPath = boost::filesystem::current_path();
-
- std::string defaultPath = currentPath.root_name().string() + storageGlobalParams.kDefaultDbPath;
- storage_options.addOptionChaining("storage.dbPath",
- "dbpath",
- optionenvironment::String,
- std::string("directory for datafiles - defaults to ") +
- storageGlobalParams.kDefaultDbPath + " which is " +
- defaultPath + " based on the current working drive");
-
-#else
- storage_options.addOptionChaining("storage.dbPath",
- "dbpath",
- optionenvironment::String,
- std::string("directory for datafiles - defaults to ") +
- storageGlobalParams.kDefaultDbPath);
-
-#endif
-
- return options->addSection(storage_options);
+ return embedded::addStorageOptions(options);
}
Status canonicalizeOptions(optionenvironment::Environment* params) {
@@ -129,5 +103,20 @@ void resetOptions() {
storageGlobalParams.reset();
}
+std::string storageDBPathDescription() {
+ StringBuilder sb;
+
+ sb << "Directory for datafiles - defaults to " << storageGlobalParams.kDefaultDbPath;
+
+#ifdef _WIN32
+ boost::filesystem::path currentPath = boost::filesystem::current_path();
+
+ sb << " which is " << currentPath.root_name().string() << storageGlobalParams.kDefaultDbPath
+ << " based on the current working drive";
+#endif
+
+ return sb.str();
+}
+
} // namespace embedded
} // namespace mongo