refactor: use is_internal function to determine plugin type instead of hardcoded list
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -274,22 +274,15 @@ async fn handle_status(
|
||||
let (binary_display, args_display) = if !is_supported {
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
} else {
|
||||
match meta_plugin_type {
|
||||
MetaPluginType::DigestSha256 | MetaPluginType::ReadTime | MetaPluginType::ReadRate |
|
||||
MetaPluginType::Cwd | MetaPluginType::Uid | MetaPluginType::User |
|
||||
MetaPluginType::Gid | MetaPluginType::Group | MetaPluginType::Shell |
|
||||
MetaPluginType::ShellPid | MetaPluginType::KeepPid | MetaPluginType::Hostname |
|
||||
MetaPluginType::FullHostname => {
|
||||
if meta_plugin.is_internal() {
|
||||
("<INTERNAL>".to_string(), "".to_string())
|
||||
},
|
||||
_ => {
|
||||
} else {
|
||||
if let Some((program, args)) = meta_plugin.program_info() {
|
||||
(program.to_string(), args.join(" "))
|
||||
} else {
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
meta_plugin_info.push(MetaPluginInfo {
|
||||
|
||||
@@ -145,17 +145,9 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
||||
let (binary_display, args_display) = if !is_supported {
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
} else {
|
||||
match meta_plugin_type {
|
||||
// For internal plugins, always show as internal
|
||||
MetaPluginType::DigestSha256 | MetaPluginType::ReadTime | MetaPluginType::ReadRate |
|
||||
MetaPluginType::Cwd | MetaPluginType::Uid | MetaPluginType::User |
|
||||
MetaPluginType::Gid | MetaPluginType::Group | MetaPluginType::Shell |
|
||||
MetaPluginType::ShellPid | MetaPluginType::KeepPid | MetaPluginType::Hostname |
|
||||
MetaPluginType::FullHostname => {
|
||||
if meta_plugin.is_internal() {
|
||||
("<INTERNAL>".to_string(), "".to_string())
|
||||
},
|
||||
// For program-based plugins, show program info
|
||||
_ => {
|
||||
} else {
|
||||
// Get program info from the meta plugin itself
|
||||
if let Some((program, args)) = meta_plugin.program_info() {
|
||||
(program.to_string(), args.join(" "))
|
||||
@@ -163,7 +155,6 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
meta_plugin_table.add_row(Row::new(vec![
|
||||
@@ -248,22 +239,15 @@ fn show_status_structured(
|
||||
let (binary_display, args_display) = if !is_supported {
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
} else {
|
||||
match meta_plugin_type {
|
||||
MetaPluginType::DigestSha256 | MetaPluginType::ReadTime | MetaPluginType::ReadRate |
|
||||
MetaPluginType::Cwd | MetaPluginType::Uid | MetaPluginType::User |
|
||||
MetaPluginType::Gid | MetaPluginType::Group | MetaPluginType::Shell |
|
||||
MetaPluginType::ShellPid | MetaPluginType::KeepPid | MetaPluginType::Hostname |
|
||||
MetaPluginType::FullHostname => {
|
||||
if meta_plugin.is_internal() {
|
||||
("<INTERNAL>".to_string(), "".to_string())
|
||||
},
|
||||
_ => {
|
||||
} else {
|
||||
if let Some((program, args)) = meta_plugin.program_info() {
|
||||
(program.to_string(), args.join(" "))
|
||||
} else {
|
||||
("<NOT FOUND>".to_string(), "".to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
meta_plugin_info.push(MetaPluginInfo {
|
||||
|
||||
Reference in New Issue
Block a user