From ee50d1133c68c98bcafbde8473036bdf05f6db43 Mon Sep 17 00:00:00 2001 From: sreedev Date: Wed, 4 Jan 2023 11:38:41 -0500 Subject: [PATCH] updated ui temporarily to fix a bug, will add a seperate TUI --- README.md | 11 +++++------ src/output.rs | 9 ++++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1130af8..f137b2c 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,11 @@ Usage: deduplicator [OPTIONS] Options: - -t, --types Filetypes to deduplicate (default = all) - -d, --delete Delete files by algorithm (default = oldest) [options = oldest | newest] - --dir Run Deduplicator on dir different from pwd - -n, --nocache Don't use cache for indexing files (default = true) - -h, --help Print help information - -V, --version Print version information + -t, --types Filetypes to deduplicate (default = all) + --dir Run Deduplicator on dir different from pwd + -n, --nocache Don't use cache for indexing files (default = true) + -h, --help Print help information + -V, --version Print version information ```

Performance

diff --git a/src/output.rs b/src/output.rs index 6076077..9abbe09 100644 --- a/src/output.rs +++ b/src/output.rs @@ -7,7 +7,14 @@ use std::{collections::HashMap, fs}; use crate::params::Params; fn format_path(path: &String, opts: &Params) -> String { - format!("...{}", path.replace(&opts.get_directory().unwrap(), "")) + let display_path = path.replace(&opts.get_directory().unwrap(), ""); + let display_range = if display_path.len() > 32 { + &display_path[(display_path.len() - 32)..] + } else { + &display_path[..] + }; + + format!("...{}", display_range) } fn file_size(path: &String) -> String {