Skip to content
Browse files

SERVER-3112: Improved stdout/err in mongoexport

  • Loading branch information...
1 parent f96f1c7 commit 29cd169c4dccacb86d33bc9e30833ea1ae422d3e Brandon Diamond committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 tools/export.cpp
View
13 tools/export.cpp
@@ -45,6 +45,19 @@ class Export : public Tool {
_usesstdout = false;
}
+ virtual void preSetup() {
+ string out = getParam("out");
+ if ( out == "-" ) {
+ // write output to standard error to avoid mangling output
+ // must happen early to avoid sending junk to stdout
+ useStandardOutput(false);
+ }
+ }
+
+ virtual void printExtraHelp( ostream & out ) {
+ out << "Export MongoDB data to CSV, TSV or JSON files.\n" << endl;
+ }
+
// Turn every double quote character into two double quote characters
// If hasSurroundingQuotes is true, doesn't escape the first and last
// characters of the string, if it's false, add a double quote character

0 comments on commit 29cd169

Please sign in to comment.
Something went wrong with that request. Please try again.