]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
config: -v or --version to print version info
authorSage Weil <sage@newdream.net>
Mon, 27 Apr 2009 20:32:50 +0000 (13:32 -0700)
committerSage Weil <sage@newdream.net>
Tue, 28 Apr 2009 18:13:49 +0000 (11:13 -0700)
src/config.cc

index 0c8ee68c5a7813f0e9af660584bf9240dde2b997..42607272e9e0191b1ec87f40ffb2e8ce45bb6230 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 
+#include "ceph_ver.h"
 #include "config.h"
 #include "include/types.h"
 
@@ -297,7 +298,8 @@ void sighup_handler(int signum)
   _dout_need_open = true;
 }
 
-#define STRINGIFY(x) #x
+#define _STR(x) #x
+#define STRINGIFY(x) _STR(x)
 
 struct config_option {
   const char *section;
@@ -945,7 +947,10 @@ void parse_startup_config_options(std::vector<const char*>& args, const char *mo
     g_conf.type = (char *)"";
 
   FOR_EACH_ARG(args) {
-    if (CONF_ARG_EQ("conf", 'c')) {
+    if (CONF_ARG_EQ("version", 'v')) {
+      cout << "ceph version " << VERSION << " (" << STRINGIFY(CEPH_GIT_VER) << ")" << std::endl;
+      _exit(0);
+    } else if (CONF_ARG_EQ("conf", 'c')) {
        CONF_SAFE_SET_ARG_VAL(&g_conf.conf, OPT_STR);
        conf_specified = true;
     } else if (CONF_ARG_EQ("monmap", 'M')) {