summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-09-22 10:07:53 -0400
committerEliot Horowitz <eliot@10gen.com>2009-09-22 10:07:53 -0400
commit665b1f748332be36432b49103a8bda69576ad99d (patch)
treeff36dbd67d6f65fde0372a469ef122f92d97d50f /shell
parenta8a42c1ea055a810fdb35fd2eeb40eee7fb5c989 (diff)
downloadmongo-665b1f748332be36432b49103a8bda69576ad99d.tar.gz
--version
Diffstat (limited to 'shell')
-rw-r--r--shell/dbshell.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index 745a258ae6c..2569da7e01e 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -210,6 +210,7 @@ string finishCode( string code ){
namespace po = boost::program_options;
void show_help_text(const char* name, po::options_description options) {
+ cout << "MongoDB shell version: " << mongo::versionString << endl;
cout << "usage: " << name << " [options] [db address] [file names (ending in .js)]" << endl
<< "db address can be:" << endl
<< " foo foo database on local machine" << endl
@@ -265,6 +266,7 @@ int _main(int argc, char* argv[]) {
("username,u", po::value<string>(&username), "username for authentication")
("password,p", po::value<string>(&password), "password for authentication")
("help,h", "show this usage information")
+ ("version", "show version information")
;
hidden_options.add_options()
@@ -310,6 +312,11 @@ int _main(int argc, char* argv[]) {
if (params.count("files")) {
files = params["files"].as< vector<string> >();
}
+ if (params.count("version")) {
+ cout << "MongoDB shell version: " << mongo::versionString << endl;
+ return mongo::EXIT_CLEAN;
+ }
+
/* This is a bit confusing, here are the rules:
*
* if nodb is set then all positional parameters are files