refactor: integrate digest functionality into meta plugins and remove digest_engine module

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-28 17:31:23 -03:00
parent 4c8c6569a9
commit e51a902660
8 changed files with 26 additions and 220 deletions

View File

@@ -112,62 +112,6 @@ fn build_compression_table() -> Table {
compression_table
}
fn build_digest_table() -> Table {
use crate::digest_engine;
use crate::digest_engine::DIGEST_PROGRAMS;
use crate::digest_engine::DigestType;
use crate::digest_engine::program::DigestEngineProgram;
let mut digest_table = Table::new();
if std::io::stdout().is_terminal() {
digest_table.set_format(*FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR);
} else {
digest_table.set_format(*FORMAT_NO_BORDER_LINE_SEPARATOR);
}
digest_table.set_titles(row!(
b->"Type",
b->"Found",
b->"Default",
b->"Binary",
b->"Args"));
let default_type = digest_engine::default_digest_type();
for digest_type in DigestType::iter() {
let digest_program: DigestEngineProgram = match &DIGEST_PROGRAMS[digest_type.clone()] {
Some(digest_program) => digest_program.clone(),
None => DigestEngineProgram {
program: "".to_string(),
args: Vec::new(),
supported: true,
},
};
let is_default = digest_type == default_type;
digest_table.add_row(Row::new(vec![
Cell::new(&digest_type.to_string()),
match digest_program.supported {
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
false => Cell::new("No").with_style(Attr::ForegroundColor(color::RED)),
},
match is_default {
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
false => Cell::new("No"),
},
match digest_program.program.is_empty() {
true => {
Cell::new("<INTERNAL>").with_style(Attr::ForegroundColor(color::BRIGHT_BLACK))
}
false => Cell::new(&digest_program.program),
},
Cell::new(&digest_program.args.join(" ")),
]));
}
digest_table
}
fn build_meta_plugin_table() -> Table {
let mut meta_plugin_table = Table::new();
@@ -231,9 +175,6 @@ pub fn mode_status(
println!("COMPRESSION:");
build_compression_table().printstd();
println!();
println!("DIGEST:");
build_digest_table().printstd();
println!();
println!("META PLUGINS:");
build_meta_plugin_table().printstd();
Ok(())