mirror of
https://github.com/ceph/ceph
synced 2025-02-19 00:47:49 +00:00
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 <kchai@redhat.com>
This commit is contained in:
parent
d781797a7b
commit
c48edcd9f2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user