(
parser: &mut ArgParser,
shared: SharedArgs,
config: &dyn CliConfig,
default_session_duration_hours: f64,
)
| 405 | } |
| 406 | |
| 407 | fn parse_claude_command( |
| 408 | parser: &mut ArgParser, |
| 409 | shared: SharedArgs, |
| 410 | config: &dyn CliConfig, |
| 411 | default_session_duration_hours: f64, |
| 412 | ) -> Result<Command, String> { |
| 413 | let command = match parser.peek() { |
| 414 | Some(command @ ("daily" | "monthly" | "weekly" | "session" | "blocks" | "statusline")) => { |
| 415 | let command = command.to_string(); |
| 416 | parser.next(); |
| 417 | command |
| 418 | } |
| 419 | Some(command) if !command.starts_with('-') => { |
| 420 | return Err(format!("Unknown claude command '{command}'")); |
| 421 | } |
| 422 | _ => "daily".to_string(), |
| 423 | }; |
| 424 | match command.as_str() { |
| 425 | "daily" => parse_claude_daily_command(parser, shared, config), |
| 426 | "monthly" => parse_claude_monthly_command(parser, shared, config), |
| 427 | "weekly" => parse_claude_weekly_command(parser, shared, config), |
| 428 | "session" => parse_claude_session_command(parser, shared, config), |
| 429 | "blocks" | "statusline" => parse_command( |
| 430 | &command, |
| 431 | parser, |
| 432 | shared, |
| 433 | config, |
| 434 | default_session_duration_hours, |
| 435 | ), |
| 436 | _ => unreachable!("claude command is prevalidated"), |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | fn parse_basic_agent_command( |
| 441 | parser: &mut ArgParser, |
no test coverage detected