From 8bc2bfa6180a7403a96dd91cc5dfe0e593da7ec6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 27 Apr 2009 13:32:50 -0700 Subject: [PATCH] config: -v or --version to print version info --- src/config.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.cc b/src/config.cc index 0c8ee68c5a781..42607272e9e01 100644 --- a/src/config.cc +++ b/src/config.cc @@ -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& 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')) { -- 2.39.5