From 7a1f1699ffad1b49da235e14f1c75a27e01d02f9 Mon Sep 17 00:00:00 2001 From: "Andrew Phillips (aider)" Date: Thu, 22 May 2025 13:26:23 -0300 Subject: [PATCH] feat: add meta_name support to MetaPluginProgram --- src/meta_plugin/program.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/meta_plugin/program.rs b/src/meta_plugin/program.rs index 4870067..ce41e7d 100644 --- a/src/meta_plugin/program.rs +++ b/src/meta_plugin/program.rs @@ -15,10 +15,11 @@ pub struct MetaPluginProgram { pub program: String, pub args: Vec, pub supported: bool, + pub meta_name: String, } impl MetaPluginProgram { - pub fn new(program: &str, args: Vec<&str>) -> MetaPluginProgram { + pub fn new(program: &str, args: Vec<&str>, meta_name: String) -> MetaPluginProgram { let program_path = get_program_path(program); let supported = program_path.is_ok(); @@ -26,6 +27,7 @@ impl MetaPluginProgram { program: program_path.unwrap_or(program.to_string()), args: args.iter().map(|s| s.to_string()).collect(), supported, + meta_name, } } } @@ -66,6 +68,10 @@ impl MetaPlugin for MetaPluginProgram { fn update(&mut self, _data: &[u8]) { // This is handled by the ProgramWriter implementation } + + fn meta_name(&mut self) -> String { + self.meta_name.clone() + } } fn get_program_path(program: &str) -> Result {