fix: support comma-separated meta plugin types and reorganize read time/rate plugins

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-29 11:57:22 -03:00
parent 00ee90a6d9
commit 3bbce80d2d

View File

@@ -175,22 +175,29 @@ pub fn cmd_args_compression_type(cmd: &mut Command, args: &Args) -> CompressionT
}
pub fn cmd_args_meta_plugin_types(cmd: &mut Command, args: &Args) -> Vec<MetaPluginType> {
let meta_plugin_names = args
.item
.meta_plugins
.clone();
let mut meta_plugin_types = Vec::new();
// Handle comma-separated values in each meta_plugins argument
for meta_plugin_names_str in &args.item.meta_plugins {
let meta_plugin_names: Vec<&str> = meta_plugin_names_str.split(',').collect();
for name in meta_plugin_names {
let meta_plugin_type_opt = MetaPluginType::from_str(&name);
let trimmed_name = name.trim();
if trimmed_name.is_empty() {
continue;
}
let meta_plugin_type_opt = MetaPluginType::from_str(trimmed_name);
if meta_plugin_type_opt.is_err() {
cmd.error(
ErrorKind::InvalidValue,
format!("Unknown meta plugin type: {}", name),
format!("Unknown meta plugin type: {}", trimmed_name),
)
.exit();
}
meta_plugin_types.push(meta_plugin_type_opt.unwrap());
}
}
meta_plugin_types
}