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:
@@ -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> {
|
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();
|
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 {
|
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() {
|
if meta_plugin_type_opt.is_err() {
|
||||||
cmd.error(
|
cmd.error(
|
||||||
ErrorKind::InvalidValue,
|
ErrorKind::InvalidValue,
|
||||||
format!("Unknown meta plugin type: {}", name),
|
format!("Unknown meta plugin type: {}", trimmed_name),
|
||||||
)
|
)
|
||||||
.exit();
|
.exit();
|
||||||
}
|
}
|
||||||
meta_plugin_types.push(meta_plugin_type_opt.unwrap());
|
meta_plugin_types.push(meta_plugin_type_opt.unwrap());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meta_plugin_types
|
meta_plugin_types
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user