From d02aa49e35c94f23c8fac0215f6bad7ff2ff4afd Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Thu, 29 Jan 2009 11:56:44 -0500 Subject: [PATCH] make run return and that is what the binary exits with --- tools/Tool.cpp | 4 +--- tools/Tool.h | 2 +- tools/dump.cpp | 4 ++-- tools/import.cpp | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/Tool.cpp b/tools/Tool.cpp index a052f57d6d2..2bd9866caeb 100644 --- a/tools/Tool.cpp +++ b/tools/Tool.cpp @@ -60,7 +60,5 @@ int mongo::Tool::main( int argc , char ** argv ){ if ( _params.count( "collection" ) ) _coll = _params["collection"].as(); - run(); - - return 0; + return run(); } diff --git a/tools/Tool.h b/tools/Tool.h index a72ca6d4964..d1092e252f7 100644 --- a/tools/Tool.h +++ b/tools/Tool.h @@ -32,7 +32,7 @@ namespace mongo { return def; } - virtual void run() = 0; + virtual int run() = 0; protected: string _name; diff --git a/tools/dump.cpp b/tools/dump.cpp index 7ec0bcae70c..2293fa105da 100644 --- a/tools/dump.cpp +++ b/tools/dump.cpp @@ -76,7 +76,7 @@ public: } - void run(){ + int run(){ path root( getParam( "out" , "dump" ) ); string db = _db; @@ -103,7 +103,7 @@ public: else { go( db , root / db ); } - + return 0; } }; diff --git a/tools/import.cpp b/tools/import.cpp index c036e7fa6c0..c4e93258e21 100644 --- a/tools/import.cpp +++ b/tools/import.cpp @@ -38,8 +38,9 @@ public: addPositionArg( "dir" , 1 ); } - void run(){ + int run(){ drillDown( getParam( "dir" ) ); + return 0; } void drillDown( path root ) {