| 678 | } |
| 679 | |
| 680 | int get_path(const boost::program_options::variables_map &vm, |
| 681 | size_t *arg_index, std::string *path) { |
| 682 | if (vm.count(at::PATH)) { |
| 683 | *path = vm[at::PATH].as<std::string>(); |
| 684 | } else { |
| 685 | *path = get_positional_argument(vm, *arg_index); |
| 686 | if (!path->empty()) { |
| 687 | ++(*arg_index); |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | if (path->empty()) { |
| 692 | std::cerr << "rbd: path was not specified" << std::endl; |
| 693 | return -EINVAL; |
| 694 | } |
| 695 | return 0; |
| 696 | } |
| 697 | |
| 698 | int get_formatter(const po::variables_map &vm, |
| 699 | at::Format::Formatter *formatter) { |