vector<string> devs;
vector<string> devs_source;
string dev_target;
- string path;
- string action;
+ string path, path_aux;
+ string action, action_aux;
string log_file;
string input_file;
string dest_file;
("help,h", "produce help message")
(",i", po::value<string>(&osd_instance), "OSD instance. Requires access to monitor/ceph.conf")
("path", po::value<string>(&path), "bluestore path")
+ ("data-path", po::value<string>(&path_aux),
+ "--path alias, ignored if the latter is present")
("out-dir", po::value<string>(&out_dir), "output directory")
("input-file", po::value<string>(&input_file), "import file")
("dest-file", po::value<string>(&dest_file), "destination file")
("yes-i-really-really-mean-it", "additional confirmation for dangerous commands")
("sharding", po::value<string>(&new_sharding), "new sharding to apply")
("resharding-ctrl", po::value<string>(&resharding_ctrl), "gives control over resharding procedure details")
+ ("op", po::value<string>(&action_aux),
+ "--command alias, ignored if the latter is present")
;
po::options_description po_positional("Positional options");
po_positional.add_options()
std::cerr << e.what() << std::endl;
exit(EXIT_FAILURE);
}
+ if (action != action_aux && !action.empty() && !action_aux.empty()) {
+ std::cerr
+ << " Ambiguous --op and --command options, please provide a single one."
+ << std::endl;
+ exit(EXIT_FAILURE);
+ }
+ if (action.empty()) {
+ action.swap(action_aux);
+ }
+ if (!path_aux.empty()) {
+ if (path.empty()) {
+ path.swap(path_aux);
+ } else if (path != path_aux) {
+ std::cerr
+ << " Ambiguous --data-path and --path options, please provide a single one."
+ << std::endl;
+ exit(EXIT_FAILURE);
+ }
+ };
+
// normalize path (remove ending '/' if any)
if (path.size() > 1 && *(path.end() - 1) == '/') {
path.resize(path.size() - 1);