if (i != opts.end()) {
chunk_algo = i->second.c_str();
if (chunk_algo != "fixed" && chunk_algo != "rabin") {
- usage_exit();
+ cerr << "unrecognized chunk-algorithm " << chunk_algo << std::endl;
+ exit(1);
}
} else {
- usage_exit();
+ cerr << "must specify chunk-algorithm" << std::endl;
+ exit(1);
}
i = opts.find("fingerprint-algorithm");
fp_algo = i->second.c_str();
if (fp_algo != "sha1" && fp_algo != "rabin"
&& fp_algo != "sha256" && fp_algo != "sha512") {
- usage_exit();
+ cerr << "unrecognized fingerprint-algorithm " << fp_algo << std::endl;
+ exit(1);
}
} else {
- usage_exit();
+ cerr << "must specify fingerprint-algorithm" << std::endl;
+ exit(1);
}
i = opts.find("chunk-size");
}
} else {
if (chunk_algo != "rabin") {
- usage_exit();
+ cerr << "must be rabin?" << std::endl;
+ exit(1);
}
}
}
if (pool_name.empty()) {
cerr << "--create-pool requested but pool_name was not specified!" << std::endl;
- usage_exit();
+ exit(1);
}
ret = rados.ioctx_create(pool_name.c_str(), io_ctx);
if (ret < 0) {
if (i != opts.end()) {
op_name= i->second.c_str();
} else {
- usage_exit();
+ cerr << "must specify op" << std::endl;
+ exit(1);
}
i = opts.find("chunk-pool");
if (i != opts.end()) {
chunk_pool_name = i->second.c_str();
} else {
- usage_exit();
+ cerr << "must specify pool" << std::endl;
+ exit(1);
}
i = opts.find("max-thread");
if (i != opts.end()) {
if (i != opts.end()) {
object_name = i->second.c_str();
} else {
- usage_exit();
+ cerr << "must specify object" << std::endl;
+ exit(1);
}
i = opts.find("target-ref");
if (i != opts.end()) {
target_object_name = i->second.c_str();
} else {
- usage_exit();
+ cerr << "must specify target ref" << std::endl;
+ exit(1);
}
i = opts.find("target-ref-pool-id");
if (i != opts.end()) {
return -EINVAL;
}
} else {
- usage_exit();
+ cerr << "must specify target-ref-pool-id" << std::endl;
+ exit(1);
}
set<hobject_t> refs;
if (i != opts.end()) {
object_name = i->second.c_str();
} else {
- usage_exit();
+ cerr << "must specify object" << std::endl;
+ exit(1);
}
set<hobject_t> refs;
cout << " refs: " << std::endl;
} else if (ceph_argparse_flag(args, i, "--debug", (char*)NULL)) {
opts["debug"] = "true";
} else {
- if (val[0] == '-')
- usage_exit();
+ if (val[0] == '-') {
+ cerr << "unrecognized option " << val << std::endl;
+ exit(1);
+ }
++i;
}
}