(
parser: &mut ArgParser,
agent: &str,
reports: &[(&str, AgentReportKind)],
)
| 532 | } |
| 533 | |
| 534 | fn parse_agent_report_kind( |
| 535 | parser: &mut ArgParser, |
| 536 | agent: &str, |
| 537 | reports: &[(&str, AgentReportKind)], |
| 538 | ) -> Result<AgentReportKind, String> { |
| 539 | let Some(command) = parser.peek() else { |
| 540 | return Ok(AgentReportKind::Daily); |
| 541 | }; |
| 542 | if let Some((_, kind)) = reports.iter().find(|(report, _)| *report == command) { |
| 543 | parser.next(); |
| 544 | return Ok(*kind); |
| 545 | } |
| 546 | if !command.starts_with('-') { |
| 547 | return Err(format!("Unknown {agent} command '{command}'")); |
| 548 | } |
| 549 | Ok(AgentReportKind::Daily) |
| 550 | } |
| 551 | |
| 552 | fn agent_command_args(shared: SharedArgs, kind: AgentReportKind) -> AgentCommandArgs { |
| 553 | AgentCommandArgs { |
no test coverage detected