1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 John Spray <john.spray@inktank.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #include "include/types.h"
16 #include "common/config.h"
17 #include "common/ceph_argparse.h"
18 #include "common/errno.h"
19 #include "global/global_init.h"
21 #include "JournalTool.h"
24 int main(int argc, const char **argv)
26 vector<const char*> args;
27 argv_to_vec(argc, argv, args);
30 auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
31 CODE_ENVIRONMENT_UTILITY, 0);
32 common_init_finish(g_ceph_context);
36 // Handle --help before calling init() so we don't depend on network.
37 if (args.empty() || (args.size() == 1 && (std::string(args[0]) == "--help" || std::string(args[0]) == "-h"))) {
42 // Connect to mon cluster, download MDS map etc
45 std::cerr << "Error in initialization: " << cpp_strerror(rc) << std::endl;
49 // Finally, execute the user's commands
52 std::cerr << "Error (" << cpp_strerror(rc) << ")" << std::endl;