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

Function parse_codex_command

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

Source from the content-addressed store, hash-verified

452}
453
454fn parse_codex_command(
455 parser: &mut ArgParser,
456 mut shared: SharedArgs,
457 config: &dyn CliConfig,
458) -> Result<Command, String> {
459 let kind = parse_agent_report_kind(parser, "codex", STANDARD_AGENT_REPORTS)?;
460 let mut codex_speed = CodexSpeed::Auto;
461 config.apply_agent_args(&mut codex_speed, None, None);
462 while parser.peek().is_some() {
463 if parse_shared_arg_for_command(parser, &mut shared)? {
464 continue;
465 }
466 match parser.next_flag()?.as_str() {
467 "--speed" => codex_speed = parse_codex_speed(&parser.value_for("--speed")?)?,
468 flag => return Err(format!("Unknown codex option '{flag}'")),
469 }
470 }
471 Ok(Command::Codex(AgentCommandArgs {
472 shared,
473 kind,
474 pi_path: None,
475 open_claw_path: None,
476 codex_speed,
477 }))
478}
479
480fn parse_pi_command(
481 parser: &mut ArgParser,

Callers 1

parse_commandFunction · 0.85

Calls 7

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

Tested by

no test coverage detected