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

Function unsupported_agent_report_error

rust/crates/ccusage-cli/src/parser.rs:694–714  ·  view source on GitHub ↗
(args: &[String])

Source from the content-addressed store, hash-verified

692}
693
694fn unsupported_agent_report_error(args: &[String]) -> Option<String> {
695 let tokens = command_tokens(args);
696 let [agent, report, ..] = tokens.as_slice() else {
697 return None;
698 };
699 if !is_agent_command(agent) || agent_report_supported(agent, report) {
700 return None;
701 }
702
703 let display = agent_display_name(agent);
704 let message = if matches!(report.as_str(), "blocks" | "statusline") {
705 format!(
706 "The \"{report}\" report is only available for Claude Code usage.\nUse \"ccusage {agent} daily\" for {display} usage reports."
707 )
708 } else {
709 format!(
710 "The \"{report}\" report is not available for {display} usage.\nUse \"ccusage {agent} daily\" for {display} usage reports."
711 )
712 };
713 Some(message)
714}
715
716pub(crate) fn command_tokens(args: &[String]) -> Vec<String> {
717 let mut tokens = Vec::new();

Callers 1

Calls 4

agent_report_supportedFunction · 0.85
agent_display_nameFunction · 0.85
command_tokensFunction · 0.70
is_agent_commandFunction · 0.70

Tested by

no test coverage detected