From 3bbce80d2d58faa79a9dcb3c0fd765f66b0f2b6f Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Tue, 29 Jul 2025 11:57:22 -0300 Subject: [PATCH] fix: support comma-separated meta plugin types and reorganize read time/rate plugins Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) --- src/modes/common.rs | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/modes/common.rs b/src/modes/common.rs index edd267c..a7dc0aa 100644 --- a/src/modes/common.rs +++ b/src/modes/common.rs @@ -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 { - let meta_plugin_names = args - .item - .meta_plugins - .clone(); - let mut meta_plugin_types = Vec::new(); - for name in meta_plugin_names { - let meta_plugin_type_opt = MetaPluginType::from_str(&name); - if meta_plugin_type_opt.is_err() { - cmd.error( - ErrorKind::InvalidValue, - format!("Unknown meta plugin type: {}", name), - ) - .exit(); + + // 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 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: {}", trimmed_name), + ) + .exit(); + } + meta_plugin_types.push(meta_plugin_type_opt.unwrap()); } - meta_plugin_types.push(meta_plugin_type_opt.unwrap()); } + meta_plugin_types }