CephInitParameters iparams(module_type);
std::string val;
for (std::vector<const char*>::iterator i = args.begin(); i != args.end(); ) {
- if (ceph_argparse_double_dash(args, i)) {
+ if (strcmp(*i, "--") == 0) {
+ /* Normally we would use ceph_argparse_double_dash. However, in this
+ * function we *don't* want to remove the double dash, because later
+ * argument parses will still need to see it. */
break;
}
else if (ceph_argparse_flag(args, i, "--version", "-v", (char*)NULL)) {
// observer notifications later.
std::string val;
for (std::vector<const char*>::iterator i = args.begin(); i != args.end(); ) {
- if (ceph_argparse_double_dash(args, i)) {
+ if (strcmp(*i, "--") == 0) {
+ /* Normally we would use ceph_argparse_double_dash. However, in this
+ * function we *don't* want to remove the double dash, because later
+ * argument parses will still need to see it. */
break;
}
else if (ceph_argparse_flag(args, i, "--show_conf", (char*)NULL)) {
bool opt_version = false;
bool opt_vernum = false;
+ global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
+ common_init_finish(g_ceph_context);
+
for (std::vector<const char*>::iterator i = args.begin();
i != args.end(); ) {
- if (strcmp(*i, "--version") == 0) {
+ if (strcmp(*i, "--") == 0) {
+ break;
+ }
+ else if (strcmp(*i, "--version") == 0) {
opt_version = true;
i = args.erase(i);
}
++i;
}
- global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
- common_init_finish(g_ceph_context);
-
if (!opt_version && !opt_vernum)
usage_exit();
argv_to_vec(argc, argv, args);
env_to_vec(args);
- // parse user input
- bool concise = false;
- parse_cmd_args(args, &in_file, &out_file, &mode, &concise);
-
// initialize globals
global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
+ // parse user input
+ bool concise = false;
+ parse_cmd_args(args, &in_file, &out_file, &mode, &concise);
+
// input
bufferlist indata;
if (!in_file.empty()) {
argv_to_vec(argc, argv, args);
env_to_vec(args);
- parse_gceph_args(args);
global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
- vec_to_argv(args, argc, argv);
+ parse_gceph_args(args);
ctx = ceph_tool_common_init(CEPH_TOOL_MODE_GUI, false);
if (!ctx) {
atexit(ceph_tool_common_shutdown_wrapper);
+ vec_to_argv(args, argc, argv);
if (cephtool_run_gui(ctx, argc, argv))
ret = 1;