summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-05-28 17:45:28 -0400
committerEliot Horowitz <eliot@10gen.com>2009-05-28 17:45:28 -0400
commit67e827bfcf54434296b186af07a26799ce298eff (patch)
treee7427aec4aa55da8ed8475da7902e8f64449af31
parent9418d5f18ba7b1f5baf1fef5b4966b1a951701ec (diff)
downloadmongo-67e827bfcf54434296b186af07a26799ce298eff.tar.gz
version() for shell
-rw-r--r--shell/utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/utils.cpp b/shell/utils.cpp
index 38581d420ad..f14a4c54438 100644
--- a/shell/utils.cpp
+++ b/shell/utils.cpp
@@ -117,6 +117,13 @@ namespace mongo {
return b.obj();
}
+
+ BSONObj JSVersion( const BSONObj& args ){
+ cout << "version: " << versionString << endl;
+ if ( strstr( versionString , "+" ) )
+ printGitVersion();
+ return BSONObj();
+ }
#ifndef _WIN32
#include <signal.h>
@@ -440,6 +447,7 @@ namespace mongo {
scope.injectNative( "sleep" , JSSleep );
scope.injectNative( "quit", Quit );
scope.injectNative( "getMemInfo" , JSGetMemInfo );
+ scope.injectNative( "version" , JSVersion );
#if !defined(_WIN32)
scope.injectNative( "allocatePorts", AllocatePorts );
scope.injectNative( "_startMongoProgram", StartMongoProgram );