| 808 | } |
| 809 | |
| 810 | void HandleNSClientDropTable(const std::vector<std::string>& parts, |
| 811 | ::fedb::client::NsClient* client) { |
| 812 | if (parts.size() < 2) { |
| 813 | std::cout << "Bad format" << std::endl; |
| 814 | return; |
| 815 | } |
| 816 | if (FLAGS_interactive) { |
| 817 | printf("Drop table %s? yes/no\n", parts[1].c_str()); |
| 818 | std::string input; |
| 819 | std::cin >> input; |
| 820 | std::transform(input.begin(), input.end(), input.begin(), ::tolower); |
| 821 | if (input != "yes") { |
| 822 | printf("'drop %s' cmd is canceled!\n", parts[1].c_str()); |
| 823 | return; |
| 824 | } |
| 825 | } |
| 826 | std::string msg; |
| 827 | bool ret = client->DropTable(parts[1], msg); |
| 828 | if (!ret) { |
| 829 | std::cout << "failed to drop. error msg: " << msg << std::endl; |
| 830 | return; |
| 831 | } |
| 832 | std::cout << "drop ok" << std::endl; |
| 833 | } |
| 834 | |
| 835 | void HandleNSClientSyncTable(const std::vector<std::string>& parts, |
| 836 | ::fedb::client::NsClient* client) { |
no test coverage detected