(&mut self, name: &str)
| 476 | } |
| 477 | |
| 478 | pub fn switch(&mut self, name: &str) -> eyre::Result<&Agent> { |
| 479 | if !self.agents.contains_key(name) { |
| 480 | eyre::bail!("No agent with name {name} found"); |
| 481 | } |
| 482 | self.active_idx = name.to_string(); |
| 483 | self.agents |
| 484 | .get(name) |
| 485 | .ok_or(eyre::eyre!("No agent with name {name} found")) |
| 486 | } |
| 487 | |
| 488 | /// This function does a number of things in the following order: |
| 489 | /// 1. Migrates old profiles if applicable |