| 507 | } |
| 508 | |
| 509 | static void autobutcher_target(color_ostream &out, const autobutcher_options &opts) { |
| 510 | if (opts.races_new) { |
| 511 | DEBUG(control,out).print("setting targets for new races to fk={}, mk={}, fa={}, ma={}\n", |
| 512 | opts.fk, opts.mk, opts.fa, opts.ma); |
| 513 | config.set_int(CONFIG_DEFAULT_FK, opts.fk); |
| 514 | config.set_int(CONFIG_DEFAULT_MK, opts.mk); |
| 515 | config.set_int(CONFIG_DEFAULT_FA, opts.fa); |
| 516 | config.set_int(CONFIG_DEFAULT_MA, opts.ma); |
| 517 | } |
| 518 | |
| 519 | if (opts.races_all) { |
| 520 | DEBUG(control,out).print("setting targets for all races on watchlist to fk={}, mk={}, fa={}, ma={}\n", |
| 521 | opts.fk, opts.mk, opts.fa, opts.ma); |
| 522 | for (auto w : watched_races) { |
| 523 | w.second->fk = opts.fk; |
| 524 | w.second->mk = opts.mk; |
| 525 | w.second->fa = opts.fa; |
| 526 | w.second->ma = opts.ma; |
| 527 | w.second->UpdateConfig(out); |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | for (auto race : opts.races) { |
| 532 | if (!race_to_id.count(*race)) { |
| 533 | out.printerr("race not found: '{}'", race->c_str()); |
| 534 | continue; |
| 535 | } |
| 536 | int id = race_to_id[*race]; |
| 537 | WatchedRace *w; |
| 538 | if (!watched_races.count(id)) { |
| 539 | w = new WatchedRace(out, id, true, opts.fk, opts.mk, opts.fa, opts.ma); |
| 540 | watched_races.emplace(id, w); |
| 541 | } else { |
| 542 | w = watched_races[id]; |
| 543 | w->fk = opts.fk; |
| 544 | w->mk = opts.mk; |
| 545 | w->fa = opts.fa; |
| 546 | w->ma = opts.ma; |
| 547 | } |
| 548 | w->UpdateConfig(out); |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | static void autobutcher_modify_watchlist(color_ostream &out, const autobutcher_options &opts) { |
| 553 | std::unordered_set<int> ids; |
no test coverage detected