fix: lookup meta plugins by meta name instead of type name

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

View File

@@ -187,15 +187,24 @@ pub fn cmd_args_meta_plugin_types(cmd: &mut Command, args: &Args) -> Vec<MetaPlu
continue; continue;
} }
let meta_plugin_type_opt = MetaPluginType::from_str(trimmed_name); // Try to find the MetaPluginType by meta name
if meta_plugin_type_opt.is_err() { let mut found = false;
for meta_plugin_type in MetaPluginType::iter() {
let mut meta_plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type.clone());
if meta_plugin.meta_name() == trimmed_name {
meta_plugin_types.push(meta_plugin_type);
found = true;
break;
}
}
if !found {
cmd.error( cmd.error(
ErrorKind::InvalidValue, ErrorKind::InvalidValue,
format!("Unknown meta plugin type: {}", trimmed_name), format!("Unknown meta plugin type: {}", trimmed_name),
) )
.exit(); .exit();
} }
meta_plugin_types.push(meta_plugin_type_opt.unwrap());
} }
} }