]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_token.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rgw / rgw_token.cc
index 04ef1fa7b4713809b28c5eb49d2070b5a177344d..a5c6f76e455b588df3f6b6eae616cc97b0c6b4fb 100644 (file)
@@ -1,5 +1,6 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
+
 /*
  * Ceph - scalable distributed file system
  *
@@ -21,7 +22,7 @@
 #include "common/ceph_argparse.h"
 #include "common/debug.h"
 #include "global/global_init.h"
-#include "include/assert.h"
+#include "include/ceph_assert.h"
 #include "include/str_list.h"
 
 #include "rgw_token.h"
@@ -62,7 +63,14 @@ int main(int argc, char **argv)
   std::string val;
   vector<const char*> args;
   argv_to_vec(argc, (const char **)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)) {
+    usage();
+    exit(0);
+  }
 
   auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
                         CODE_ENVIRONMENT_UTILITY, 0);
@@ -110,7 +118,6 @@ int main(int argc, char **argv)
 
   if ((! do_encode) ||
       (type == RGWToken::TOKEN_NONE)) {
-    usage();
     return -EINVAL;
   }