MCPcopy Create free account
hub / github.com/ccusage/ccusage / parse_pi_command

Function parse_pi_command

rust/crates/ccusage-cli/src/parser.rs:480–505  ·  view source on GitHub ↗
(
    parser: &mut ArgParser,
    mut shared: SharedArgs,
    config: &dyn CliConfig,
)

Source from the content-addressed store, hash-verified

478}
479
480fn parse_pi_command(
481 parser: &mut ArgParser,
482 mut shared: SharedArgs,
483 config: &dyn CliConfig,
484) -> Result<Command, String> {
485 let kind = parse_agent_report_kind(parser, "pi", STANDARD_AGENT_REPORTS)?;
486 let mut pi_path = None;
487 let mut codex_speed = CodexSpeed::Auto;
488 config.apply_agent_args(&mut codex_speed, Some(&mut pi_path), None);
489 while parser.peek().is_some() {
490 if parse_shared_arg_for_command(parser, &mut shared)? {
491 continue;
492 }
493 match parser.next_flag()?.as_str() {
494 "--pi-path" => pi_path = Some(parser.value_for("--pi-path")?),
495 flag => return Err(format!("Unknown pi option '{flag}'")),
496 }
497 }
498 Ok(Command::Pi(AgentCommandArgs {
499 shared,
500 kind,
501 pi_path,
502 open_claw_path: None,
503 codex_speed,
504 }))
505}
506
507fn parse_openclaw_command(
508 parser: &mut ArgParser,

Callers 1

parse_commandFunction · 0.85

Calls 6

parse_agent_report_kindFunction · 0.85
peekMethod · 0.80
next_flagMethod · 0.80
value_forMethod · 0.80
apply_agent_argsMethod · 0.45

Tested by

no test coverage detected