summaryrefslogtreecommitdiff
path: root/tools/export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/export.cpp')
-rw-r--r--tools/export.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/export.cpp b/tools/export.cpp
index c3a5420..0d9f022 100644
--- a/tools/export.cpp
+++ b/tools/export.cpp
@@ -45,6 +45,19 @@ public:
_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