summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2014-09-23 15:04:16 -0400
committerBenety Goh <benety@mongodb.com>2014-09-23 16:06:13 -0400
commita0aed05f92ea5a179534ff4b6d491abd759ed108 (patch)
treeb92072a7847d9390bedaeaa938e3b79c7ff10530
parent812916f5335f54b1b3944889fedc28b78997ebf3 (diff)
downloadmongo-a0aed05f92ea5a179534ff4b6d491abd759ed108.tar.gz
SERVER-15096 make mongoshim --dbpath option mandatory
-rw-r--r--src/mongo/tools/mongoshim_options.cpp7
-rw-r--r--src/mongo/util/options_parser/option_section.cpp20
-rw-r--r--src/mongo/util/options_parser/option_section.h6
3 files changed, 4 insertions, 29 deletions
diff --git a/src/mongo/tools/mongoshim_options.cpp b/src/mongo/tools/mongoshim_options.cpp
index 02483d7e1ff..4056e523e72 100644
--- a/src/mongo/tools/mongoshim_options.cpp
+++ b/src/mongo/tools/mongoshim_options.cpp
@@ -92,8 +92,6 @@ namespace mongo {
options->addOptionChaining("sort", "sort", moe::String,
"sort order, as a JSON string, e.g., '{x:1}'");
- options->findOption( "dbpath" )->setDefault( moe::Value(std::string("/data/db")) );
-
return Status::OK();
}
@@ -122,7 +120,10 @@ namespace mongo {
return ret;
}
- invariant( toolGlobalParams.useDirectClient );
+ if (!toolGlobalParams.useDirectClient) {
+ return Status(ErrorCodes::BadValue,
+ "MongoShim requires a --dbpath value to proceed");
+ }
ret = storeFieldOptions(params, args);
if (!ret.isOK()) {
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp
index a5cdb14e3e3..2dc3b9d0706 100644
--- a/src/mongo/util/options_parser/option_section.cpp
+++ b/src/mongo/util/options_parser/option_section.cpp
@@ -597,25 +597,5 @@ namespace optionenvironment {
}
}
- OptionDescription* OptionSection::findOption(const std::string& dottedName ) {
- for (std::list<OptionDescription>::iterator i = _options.begin();
- i != _options.end();
- ++i) {
- OptionDescription& od = *i;
- if ( dottedName == od._dottedName )
- return &od;
- }
-
- for ( std::list<OptionSection>::iterator i = _subSections.begin();
- i != _subSections.end();
- ++i ) {
- OptionSection& os = *i;
- OptionDescription* od = os.findOption( dottedName );
- if ( od )
- return od;
- }
- return NULL;
- }
-
} // namespace optionenvironment
} // namespace mongo
diff --git a/src/mongo/util/options_parser/option_section.h b/src/mongo/util/options_parser/option_section.h
index 37e81c6e8f7..63d75c852c8 100644
--- a/src/mongo/util/options_parser/option_section.h
+++ b/src/mongo/util/options_parser/option_section.h
@@ -149,12 +149,6 @@ namespace optionenvironment {
std::string positionalHelpString(const std::string& execName) const;
std::string helpString() const;
- /**
- * Looks in self and all children for the given option.
- * @ return actual modifiable reference or NULL
- */
- OptionDescription* findOption(const std::string& dottedName );
-
// Debugging
void dump() const;