Add --version command line option

This commit is contained in:
Vinnie Falco
2013-10-16 13:29:43 -07:00
parent abe4f1ba03
commit 582b5bb3ac

View File

@@ -281,6 +281,7 @@ int RippleMain::run (int argc, char const* const* argv)
("net", "Get the initial ledger from the network.")
("fg", "Run in the foreground.")
("import", importDescription.toStdString ().c_str ())
("version", "Display the build version.")
;
// Interpret positional arguments as --parameters.
@@ -334,6 +335,13 @@ int RippleMain::run (int argc, char const* const* argv)
iResult = 1;
}
if (vm.count ("version"))
{
String const& s (BuildInfo::getVersionString ());
std::cout << "rippled version " << s.toStdString() << std::endl;
return 0;
}
// Use a watchdog process unless we're invoking a stand alone type of mode
//
if (HaveSustain ()