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:
@@ -185,9 +185,15 @@ pub fn process_metadata_outputs(internal_name: &str, value: serde_yaml::Value, o
|
||||
}
|
||||
|
||||
pub trait MetaPlugin where Self: 'static {
|
||||
fn meta_type(&self) -> MetaPluginType;
|
||||
|
||||
// For backward compatibility, provide meta_name() that uses meta_type()
|
||||
fn meta_name(&self) -> String {
|
||||
self.meta_type().to_string()
|
||||
}
|
||||
|
||||
fn is_supported(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn is_internal(&self) -> bool {
|
||||
true
|
||||
@@ -218,7 +224,7 @@ pub trait MetaPlugin where Self: 'static {
|
||||
}
|
||||
}
|
||||
|
||||
fn meta_name(&self) -> String;
|
||||
fn meta_type(&self) -> MetaPluginType;
|
||||
|
||||
// Get program information for display in status
|
||||
fn program_info(&self) -> Option<(&str, Vec<&str>)> {
|
||||
@@ -294,7 +300,7 @@ pub fn get_meta_plugin(
|
||||
// For command type, we need to parse the command from options
|
||||
let mut program_name = String::new();
|
||||
let mut args = Vec::new();
|
||||
let mut meta_name = "command".to_string();
|
||||
let meta_name = MetaPluginType::Command.to_string();
|
||||
let mut split_whitespace = true;
|
||||
|
||||
if let Some(opts) = &options {
|
||||
|
||||
Reference in New Issue
Block a user