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:
Andrew Phillips
2025-08-11 12:15:51 -03:00
parent f5149cfb68
commit e2bcdd2acf
2 changed files with 22 additions and 45 deletions

View File

@@ -274,20 +274,13 @@ 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 => {
("<INTERNAL>".to_string(), "".to_string())
},
_ => {
if let Some((program, args)) = meta_plugin.program_info() {
(program.to_string(), args.join(" "))
} else {
("<NOT FOUND>".to_string(), "".to_string())
}
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())
}
}
};