]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/cephfs/cephfs-journal-tool.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / tools / cephfs / cephfs-journal-tool.cc
index e4c1287d45575e808fa2d55918647402215ff344..290cb305ba5274d38f442ce5b27023eff9a85ca8 100644 (file)
@@ -25,7 +25,14 @@ int main(int argc, const char **argv)
 {
   vector<const char*> args;
   argv_to_vec(argc, argv, args);
-  env_to_vec(args);
+  if (args.empty()) {
+    cerr << argv[0] << ": -h or --help for usage" << std::endl;
+    exit(1);
+  }
+  if (ceph_argparse_need_usage(args)) {
+    JournalTool::usage();
+    exit(0);
+  }
 
   auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
                             CODE_ENVIRONMENT_UTILITY, 0);
@@ -33,12 +40,6 @@ int main(int argc, const char **argv)
 
   JournalTool jt;
 
-  // Handle --help before calling init() so we don't depend on network.
-  if (args.empty() || (args.size() == 1 && (std::string(args[0]) == "--help" || std::string(args[0]) == "-h"))) {
-    jt.usage();
-    return 0;
-  }
-
   // Connect to mon cluster, download MDS map etc
   int rc = jt.init();
   if (rc != 0) {