feat: add enabled column to meta plugins status table
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -113,7 +113,7 @@ fn build_compression_table() -> Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn build_meta_plugin_table() -> Table {
|
fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table {
|
||||||
let mut meta_plugin_table = Table::new();
|
let mut meta_plugin_table = Table::new();
|
||||||
if std::io::stdout().is_terminal() {
|
if std::io::stdout().is_terminal() {
|
||||||
meta_plugin_table.set_format(*FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR);
|
meta_plugin_table.set_format(*FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR);
|
||||||
@@ -124,6 +124,7 @@ fn build_meta_plugin_table() -> Table {
|
|||||||
meta_plugin_table.set_titles(row!(
|
meta_plugin_table.set_titles(row!(
|
||||||
b->"Type",
|
b->"Type",
|
||||||
b->"Found",
|
b->"Found",
|
||||||
|
b->"Enabled",
|
||||||
b->"Binary",
|
b->"Binary",
|
||||||
b->"Args",
|
b->"Args",
|
||||||
b->"Meta Name"));
|
b->"Meta Name"));
|
||||||
@@ -131,6 +132,7 @@ fn build_meta_plugin_table() -> Table {
|
|||||||
for meta_plugin_type in MetaPluginType::iter() {
|
for meta_plugin_type in MetaPluginType::iter() {
|
||||||
let mut meta_plugin = meta_plugin::get_meta_plugin(meta_plugin_type.clone());
|
let mut meta_plugin = meta_plugin::get_meta_plugin(meta_plugin_type.clone());
|
||||||
let is_supported = meta_plugin.is_supported();
|
let is_supported = meta_plugin.is_supported();
|
||||||
|
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
||||||
|
|
||||||
// Get program info for display purposes
|
// Get program info for display purposes
|
||||||
let meta_plugin_program: Option<MetaPluginProgram> = META_PLUGIN_PROGRAMS[meta_plugin_type.clone()].clone();
|
let meta_plugin_program: Option<MetaPluginProgram> = META_PLUGIN_PROGRAMS[meta_plugin_type.clone()].clone();
|
||||||
@@ -162,6 +164,10 @@ fn build_meta_plugin_table() -> Table {
|
|||||||
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
|
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
|
||||||
false => Cell::new("No").with_style(Attr::ForegroundColor(color::RED)),
|
false => Cell::new("No").with_style(Attr::ForegroundColor(color::RED)),
|
||||||
},
|
},
|
||||||
|
match is_enabled {
|
||||||
|
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
|
||||||
|
false => Cell::new("No"),
|
||||||
|
},
|
||||||
Cell::new(&binary_display),
|
Cell::new(&binary_display),
|
||||||
Cell::new(&args_display),
|
Cell::new(&args_display),
|
||||||
Cell::new(&meta_plugin.meta_name()),
|
Cell::new(&meta_plugin.meta_name()),
|
||||||
@@ -173,10 +179,27 @@ fn build_meta_plugin_table() -> Table {
|
|||||||
|
|
||||||
pub fn mode_status(
|
pub fn mode_status(
|
||||||
_cmd: &mut Command,
|
_cmd: &mut Command,
|
||||||
_args: &crate::Args,
|
args: &crate::Args,
|
||||||
data_path: PathBuf,
|
data_path: PathBuf,
|
||||||
db_path: PathBuf,
|
db_path: PathBuf,
|
||||||
) -> Result<(), anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
|
// Determine which meta plugins would be enabled for a save operation
|
||||||
|
let mut meta_plugin_types: Vec<MetaPluginType> = crate::modes::common::cmd_args_meta_plugin_types(_cmd, &args);
|
||||||
|
|
||||||
|
// Add digest type if specified
|
||||||
|
let digest_type = crate::modes::common::cmd_args_digest_type(_cmd, &args);
|
||||||
|
let digest_meta_plugin_type = match digest_type {
|
||||||
|
crate::meta_plugin::MetaPluginType::DigestSha256 => Some(MetaPluginType::DigestSha256),
|
||||||
|
crate::meta_plugin::MetaPluginType::DigestMd5 => Some(MetaPluginType::DigestMd5),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(digest_plugin_type) = digest_meta_plugin_type {
|
||||||
|
if !meta_plugin_types.contains(&digest_plugin_type) {
|
||||||
|
meta_plugin_types.push(digest_plugin_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
println!("PATHS:");
|
println!("PATHS:");
|
||||||
build_path_table(data_path, db_path).printstd();
|
build_path_table(data_path, db_path).printstd();
|
||||||
println!();
|
println!();
|
||||||
@@ -184,6 +207,6 @@ pub fn mode_status(
|
|||||||
build_compression_table().printstd();
|
build_compression_table().printstd();
|
||||||
println!();
|
println!();
|
||||||
println!("META PLUGINS:");
|
println!("META PLUGINS:");
|
||||||
build_meta_plugin_table().printstd();
|
build_meta_plugin_table(&meta_plugin_types).printstd();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user