From: Kefu Chai Date: Sun, 17 Nov 2019 15:26:51 +0000 (+0800) Subject: librados-config: add --release option X-Git-Tag: v15.1.0~776^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c48edcd9f23e86c2b0b35a90bbb9ca17b93aee73;p=ceph.git librados-config: add --release option so it prints current release name along with release type. it can be used by tests for querying the branch name Fixes: https://tracker.ceph.com/issues/42782 Signed-off-by: Kefu Chai --- diff --git a/src/librados-config.cc b/src/librados-config.cc index 36bda89bb63ed..7948598b1b211 100644 --- a/src/librados-config.cc +++ b/src/librados-config.cc @@ -20,6 +20,7 @@ #include #include "include/rados/librados.h" +#include "ceph_ver.h" namespace po = boost::program_options; @@ -29,7 +30,8 @@ int main(int argc, const char **argv) desc.add_options() ("help,h", "print this help message") ("version", "library version") - ("vernum", "library version code"); + ("vernum", "library version code") + ("release", "print release name"); po::parsed_options parsed = po::command_line_parser(argc, argv).options(desc).run(); @@ -45,6 +47,10 @@ int main(int argc, const char **argv) std::cout << maj << "." << min << "." << ext << std::endl; } else if (vm.count("vernum")) { std::cout << std::hex << LIBRADOS_VERSION_CODE << std::dec << std::endl; + } else if (vm.count("release")) { + std::cout << CEPH_RELEASE_NAME << ' ' + << '(' << CEPH_RELEASE_TYPE << ')' + << std::endl; } else { std::cerr << argv[0] << ": -h or --help for usage" << std::endl; return 1;