| 417 | } |
| 418 | |
| 419 | int execute(const po::variables_map &vm, |
| 420 | const std::vector<std::string> &ceph_global_init_args) { |
| 421 | std::string first_diff = utils::get_positional_argument(vm, 0); |
| 422 | if (first_diff.empty()) { |
| 423 | std::cerr << "rbd: first diff was not specified" << std::endl; |
| 424 | return -EINVAL; |
| 425 | } |
| 426 | |
| 427 | std::string second_diff = utils::get_positional_argument(vm, 1); |
| 428 | if (second_diff.empty()) { |
| 429 | std::cerr << "rbd: second diff was not specified" << std::endl; |
| 430 | return -EINVAL; |
| 431 | } |
| 432 | |
| 433 | std::string path; |
| 434 | size_t arg_index = 2; |
| 435 | int r = utils::get_path(vm, &arg_index, &path); |
| 436 | if (r < 0) { |
| 437 | return r; |
| 438 | } |
| 439 | |
| 440 | r = do_merge_diff(first_diff.c_str(), second_diff.c_str(), path.c_str(), |
| 441 | vm[at::NO_PROGRESS].as<bool>()); |
| 442 | if (r < 0) { |
| 443 | std::cerr << "rbd: merge-diff error" << std::endl; |
| 444 | return -r; |
| 445 | } |
| 446 | |
| 447 | return 0; |
| 448 | } |
| 449 | |
| 450 | Shell::Action action( |
| 451 | {"merge-diff"}, {}, "Merge two diff exports together.", "", |
nothing calls this directly
no test coverage detected