Add bytesize and chrono, improve console output formatting

- Added `bytesize` and `chrono` dependencies in `Cargo.toml` and `Cargo.lock` for enhanced size and time formatting.
- Enhanced console output in `list.rs`, `index.rs`, `clean.rs`, and `config.rs` with improved styles for readability.
- Updated file size and modified time formatting across commands using `ByteSize` and `chrono`.
This commit is contained in:
elipeter 2025-06-23 19:37:19 +02:00
parent 47d850843c
commit 17d327a572
6 changed files with 196 additions and 45 deletions

View file

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use std::path::{Path};
use std::fs;
use console::style;
use toml;
use crate::patterns::Severity;
@ -187,10 +188,15 @@ impl Config {
let user_config: Config = toml::from_str(&user_config_content)?;
config = merge_configs(config, user_config);
println!("Loaded user config from: {}", user_config_path.display());
println!("{}: Loaded user config from: {}\n",
style("note").green().bold(),
style(user_config_path.display()).underlined().white().bold());
} else {
println!("Using default configuration. Create {} to customize.", user_config_path.display());
println!("{}: Using {} configuration.\n Create file in '{}'to customize.\n",
style("note").green().bold(),
style("default").bold(),
style(user_config_path.display()).underlined().white().bold());
}
Ok(config)