| 558 | } |
| 559 | |
| 560 | command_result Commands::dump_rpc(color_ostream& con, Core& core, const std::string& first, const std::vector<std::string>& parts) |
| 561 | { |
| 562 | if (parts.size() == 1) |
| 563 | { |
| 564 | std::ofstream file(parts[0]); |
| 565 | CoreService coreSvc; |
| 566 | coreSvc.dumpMethods(file); |
| 567 | |
| 568 | for (auto& it : *core.getPluginManager()) |
| 569 | { |
| 570 | Plugin* plug = it.second; |
| 571 | if (!plug) |
| 572 | continue; |
| 573 | |
| 574 | std::unique_ptr<RPCService> svc(plug->rpc_connect(con)); |
| 575 | if (!svc) |
| 576 | continue; |
| 577 | |
| 578 | file << "// Plugin: " << plug->getName() << std::endl; |
| 579 | svc->dumpMethods(file); |
| 580 | } |
| 581 | } |
| 582 | else |
| 583 | { |
| 584 | con << "Usage: devel/dump-rpc \"filename\"" << std::endl; |
| 585 | return CR_WRONG_USAGE; |
| 586 | } |
| 587 | return CR_OK; |
| 588 | } |
| 589 | } |
nothing calls this directly
no test coverage detected