(
table: &mut SimpleTable,
row: &UsageSummary,
compact: bool,
include_last_activity: bool,
shared: &SharedArgs,
)
| 403 | } |
| 404 | |
| 405 | fn push_breakdown_rows( |
| 406 | table: &mut SimpleTable, |
| 407 | row: &UsageSummary, |
| 408 | compact: bool, |
| 409 | include_last_activity: bool, |
| 410 | shared: &SharedArgs, |
| 411 | ) { |
| 412 | for breakdown in &row.model_breakdowns { |
| 413 | let total = breakdown.input_tokens |
| 414 | + breakdown.output_tokens |
| 415 | + breakdown.cache_creation_tokens |
| 416 | + breakdown.cache_read_tokens; |
| 417 | let mut values = if compact { |
| 418 | vec![ |
| 419 | color( |
| 420 | shared, |
| 421 | format!(" └─ {}", short_model_name(&breakdown.model_name)), |
| 422 | Color::Grey, |
| 423 | ), |
| 424 | String::new(), |
| 425 | color(shared, format_number(breakdown.input_tokens), Color::Grey), |
| 426 | color(shared, format_number(breakdown.output_tokens), Color::Grey), |
| 427 | color(shared, format_currency(breakdown.cost), Color::Grey), |
| 428 | ] |
| 429 | } else { |
| 430 | vec![ |
| 431 | color( |
| 432 | shared, |
| 433 | format!(" └─ {}", short_model_name(&breakdown.model_name)), |
| 434 | Color::Grey, |
| 435 | ), |
| 436 | String::new(), |
| 437 | color(shared, format_number(breakdown.input_tokens), Color::Grey), |
| 438 | color(shared, format_number(breakdown.output_tokens), Color::Grey), |
| 439 | color( |
| 440 | shared, |
| 441 | format_number(breakdown.cache_creation_tokens), |
| 442 | Color::Grey, |
| 443 | ), |
| 444 | color( |
| 445 | shared, |
| 446 | format_number(breakdown.cache_read_tokens), |
| 447 | Color::Grey, |
| 448 | ), |
| 449 | color(shared, format_number(total), Color::Grey), |
| 450 | color(shared, format_currency(breakdown.cost), Color::Grey), |
| 451 | ] |
| 452 | }; |
| 453 | if shared.no_cost { |
| 454 | values.pop(); |
| 455 | } |
| 456 | if include_last_activity { |
| 457 | values.push(String::new()); |
| 458 | } |
| 459 | table.push(values); |
| 460 | } |
| 461 | } |
| 462 |
no test coverage detected