]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados-config: add --release option
authorKefu Chai <kchai@redhat.com>
Sun, 17 Nov 2019 15:26:51 +0000 (23:26 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 17 Nov 2019 17:29:52 +0000 (01:29 +0800)
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 <kchai@redhat.com>
src/librados-config.cc

index 36bda89bb63edecf1039cd1fed691c87cda8cde6..7948598b1b211e6770ce80c825f0d5ed30449198 100644 (file)
@@ -20,6 +20,7 @@
 #include <boost/program_options/variables_map.hpp>
 
 #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;