refactor: replace meta_name with MetaPluginType from strum

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 21:04:52 -03:00
parent 892a3f24a5
commit 79fdf05d84
14 changed files with 36 additions and 32 deletions

View File

@@ -9,7 +9,6 @@ pub struct MetaPluginCommand {
pub program: String,
pub args: Vec<String>,
pub supported: bool,
pub meta_name: String,
pub split_whitespace: bool,
process: Option<Child>,
writer: Option<Box<dyn Write>>,
@@ -67,7 +66,6 @@ impl MetaPluginCommand {
program: program_path.map_or_else(|_| program.to_string(), |p| p.to_string_lossy().to_string()),
args: args.iter().map(|s| s.to_string()).collect(),
supported,
meta_name,
split_whitespace,
process: None,
writer: None,
@@ -158,7 +156,7 @@ impl MetaPlugin for MetaPluginCommand {
// Use process_metadata_outputs to handle output mapping
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
&self.meta_name,
&self.meta_type().to_string(),
serde_yaml::Value::String(result),
&self.outputs
) {
@@ -192,8 +190,8 @@ impl MetaPlugin for MetaPluginCommand {
}
}
fn meta_name(&self) -> String {
self.meta_name.clone()
fn meta_type(&self) -> MetaPluginType {
MetaPluginType::Command
}
fn program_info(&self) -> Option<(&str, Vec<&str>)> {