diff --git a/src/common/status.rs b/src/common/status.rs index 18c1caa..983e235 100644 --- a/src/common/status.rs +++ b/src/common/status.rs @@ -46,6 +46,7 @@ pub fn generate_status_info( data_path: PathBuf, db_path: PathBuf, enabled_meta_plugins: &Vec, + enabled_compression_type: Option, ) -> StatusInfo { let path_info = PathInfo { data: data_path.into_os_string().into_string().expect("Unable to convert data path to string"), @@ -72,6 +73,7 @@ pub fn generate_status_info( }; let is_default = compression_type == default_type; + let is_enabled = enabled_compression_type.as_ref().map_or(false, |ct| *ct == compression_type); let binary = if compression_program.program.is_empty() { "".to_string() } else { @@ -81,7 +83,7 @@ pub fn generate_status_info( compression_info.push(CompressionInfo { compression_type: compression_type.to_string(), found: compression_program.supported, - default: is_default, + default: is_enabled, // Changed from is_default to is_enabled binary, compress: compression_program.compress.join(" "), decompress: compression_program.decompress.join(" "), diff --git a/src/modes/status.rs b/src/modes/status.rs index 4b626ac..5f879c0 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -13,6 +13,7 @@ use prettytable::format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR; use crate::meta_plugin::MetaPluginType; use crate::common::status::{generate_status_info, PathInfo, CompressionInfo, MetaPluginInfo}; +use crate::compression_engine::CompressionType; fn build_path_table(path_info: &PathInfo) -> Table { let mut path_table = Table::new(); @@ -52,7 +53,7 @@ fn build_compression_table(compression_info: &Vec) -> Table { compression_table.set_titles(row!( b->"Type", b->"Found", - b->"Default", + b->"Enabled", b->"Binary", b->"Compress", b->"Decompress")); @@ -142,8 +143,15 @@ pub fn mode_status( } } + // Determine which compression type would be enabled for a save operation + let enabled_compression_type = if let Some(compression_name) = &settings.compression { + CompressionType::from_str(compression_name).ok() + } else { + Some(crate::compression_engine::default_compression_type()) + }; + let output_format = crate::modes::common::settings_output_format(settings); - let status_info = generate_status_info(data_path, db_path, &meta_plugin_types); + let status_info = generate_status_info(data_path, db_path, &meta_plugin_types, enabled_compression_type); match output_format { OutputFormat::Table => {