diff options
author | Mike Dirolf <mike@10gen.com> | 2009-06-25 16:40:39 -0400 |
---|---|---|
committer | Mike Dirolf <mike@10gen.com> | 2009-06-25 16:40:39 -0400 |
commit | 39c11c8283871be0943dd4120a9fccef2483ca40 (patch) | |
tree | b6dfdb1246ed9795429703c7653d7a66286d900c /tools | |
parent | 97fe2a917776f30baf91c6068d72438cc117df9d (diff) | |
download | mongo-39c11c8283871be0943dd4120a9fccef2483ca40.tar.gz |
importjson: show help text for bad arguments
Diffstat (limited to 'tools')
-rw-r--r-- | tools/importJSON.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/importJSON.cpp b/tools/importJSON.cpp index 28bd48b72ba..dc776e27cce 100644 --- a/tools/importJSON.cpp +++ b/tools/importJSON.cpp @@ -47,6 +47,7 @@ public: string filename = getParam( "file" ); if ( filename.size() == 0 ){ cerr << "need to specify a file!" << endl; + printHelp(cerr); return -1; } @@ -59,7 +60,14 @@ public: in = &file; } - string ns = getNS(); + string ns; + + try { + ns = getNS(); + } catch (...) { + printHelp(cerr); + return -1; + } if ( hasParam( "drop" ) ){ cout << "dropping: " << ns << endl; |