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

Function command_tokens

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

Source from the content-addressed store, hash-verified

714}
715
716pub(crate) fn command_tokens(args: &[String]) -> Vec<String> {
717 let mut tokens = Vec::new();
718 let mut index = 0;
719 while let Some(arg) = args.get(index) {
720 if arg.starts_with('-') {
721 if option_takes_value(arg) && !arg.contains('=') {
722 index += 2;
723 } else {
724 index += 1;
725 }
726 continue;
727 }
728 tokens.push(arg.clone());
729 index += 1;
730 }
731 tokens
732}
733
734fn option_takes_value(arg: &str) -> bool {
735 matches!(

Callers 3

blocks_command_tokensFunction · 0.70
help_text_for_argsFunction · 0.70

Calls 2

pushMethod · 0.80
option_takes_valueFunction · 0.70

Tested by

no test coverage detected