chore: implement meta plugin type parsing in cmd_args_meta_plugin_types

This commit is contained in:
Andrew Phillips (aider)
2025-05-22 15:44:58 -03:00
parent d4d17b93e1
commit 4ef75a6917

View File

@@ -160,12 +160,23 @@ 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> {
// TODO: Fix this
let meta_plugin_names = args
.item
.meta_plugins
.clone()
.unwrap_or([]);
.unwrap_or_else(|| vec![]);
// TOOD: Return a list of plugin types by loop over each name and converting it to a plugin type
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();
}
meta_plugin_types.push(meta_plugin_type_opt.unwrap());
}
meta_plugin_types
}