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

Function parse_cost_source

rust/crates/ccusage-cli/src/parser.rs:913–921  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

911}
912
913fn parse_cost_source(value: &str) -> Result<CostSource, String> {
914 match value {
915 "auto" => Ok(CostSource::Auto),
916 "ccusage" => Ok(CostSource::Ccusage),
917 "cc" => Ok(CostSource::Cc),
918 "both" => Ok(CostSource::Both),
919 _ => Err(format!("Invalid cost source '{value}'")),
920 }
921}
922
923#[cfg(test)]
924mod tests {

Callers 1

parse_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected