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"
11 int main(int argc, const char **argv)
13 vector<const char*> args;
14 argv_to_vec(argc, argv, args);
17 auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
18 CODE_ENVIRONMENT_UTILITY, 0);
19 common_init_finish(g_ceph_context);
23 // Handle --help before calling init() so we don't depend on network.
24 if (args.empty() || (args.size() == 1 && (std::string(args[0]) == "--help" || std::string(args[0]) == "-h"))) {
29 // Connect to mon cluster, download MDS map etc
30 int rc = data_scan.init();
32 std::cerr << "Error in initialization: " << cpp_strerror(rc) << std::endl;
36 // Finally, execute the user's commands
37 rc = data_scan.main(args);
39 std::cerr << "Error (" << cpp_strerror(rc) << ")" << std::endl;