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

Function main

rust/crates/ccusage/src/main.rs:125–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123}
124
125fn main() -> Result<()> {
126 let cli = cli::parse();
127 match cli.command {
128 Some(Command::All(args)) => adapter::all::run(args),
129 Some(Command::Daily(args)) => commands::run_daily(args),
130 Some(Command::Monthly(shared)) => commands::run_bucket(shared, BucketKind::Monthly),
131 Some(Command::Weekly(args)) => commands::run_weekly(args),
132 Some(Command::Session(args)) => commands::run_session(args),
133 Some(Command::Blocks(args)) => commands::run_blocks(args),
134 Some(Command::Statusline(args)) => commands::run_statusline(args),
135 Some(Command::Codex(args)) => adapter::codex::run(args),
136 Some(Command::OpenCode(args)) => adapter::opencode::run(args),
137 Some(Command::Amp(args)) => adapter::amp::run(args),
138 Some(Command::Droid(args)) => adapter::droid::run(args),
139 Some(Command::Codebuff(args)) => adapter::codebuff::run(args),
140 Some(Command::Hermes(args)) => adapter::hermes::run(args),
141 Some(Command::Pi(args)) => adapter::pi::run(args),
142 Some(Command::Goose(args)) => adapter::goose::run(args),
143 Some(Command::Kilo(args)) => adapter::kilo::run(args),
144 Some(Command::Qwen(args)) => adapter::qwen::run(args),
145 Some(Command::Copilot(args)) => adapter::copilot::run(args),
146 Some(Command::Gemini(args)) => adapter::gemini::run(args),
147 Some(Command::Kimi(args)) => adapter::kimi::run(args),
148 Some(Command::OpenClaw(args)) => adapter::openclaw::run(args),
149 None => {
150 let args = AgentCommandArgs {
151 shared: cli.shared,
152 kind: AgentReportKind::Daily,
153 pi_path: None,
154 open_claw_path: None,
155 codex_speed: cli::CodexSpeed::Auto,
156 };
157 adapter::all::run(args)
158 }
159 }
160}
161
162#[cfg(test)]
163mod tests {

Callers

nothing calls this directly

Calls 8

run_dailyFunction · 0.85
run_bucketFunction · 0.85
run_weeklyFunction · 0.85
run_sessionFunction · 0.85
run_blocksFunction · 0.85
run_statuslineFunction · 0.85
parseFunction · 0.70
runFunction · 0.50

Tested by

no test coverage detected