]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/cephfs/cephfs-table-tool.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / tools / cephfs / cephfs-table-tool.cc
1
2 #include "include/types.h"
3 #include "common/config.h"
4 #include "common/ceph_argparse.h"
5 #include "common/errno.h"
6 #include "global/global_init.h"
7
8 #include "TableTool.h"
9
10
11 int main(int argc, const char **argv)
12 {
13 vector<const char*> args;
14 argv_to_vec(argc, argv, args);
15
16 if (args.empty()) {
17 cerr << argv[0] << ": -h or --help for usage" << std::endl;
18 exit(1);
19 }
20 if (ceph_argparse_need_usage(args)) {
21 TableTool::usage();
22 exit(0);
23 }
24
25 auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
26 CODE_ENVIRONMENT_UTILITY, 0);
27 common_init_finish(g_ceph_context);
28
29 TableTool tt;
30
31 // Connect to mon cluster, download MDS map etc
32 int rc = tt.init();
33 if (rc != 0) {
34 std::cerr << "Error in initialization: " << cpp_strerror(rc) << std::endl;
35 return rc;
36 }
37
38 // Finally, execute the user's commands
39 rc = tt.main(args);
40 if (rc != 0) {
41 std::cerr << "Error (" << cpp_strerror(rc) << ")" << std::endl;
42 }
43
44 return rc;
45 }
46
47