updated ui temporarily to fix a bug, will add a seperate TUI

This commit is contained in:
sreedev
2023-01-04 11:38:41 -05:00
parent b46dc9bf15
commit ee50d1133c
2 changed files with 13 additions and 7 deletions

View File

@@ -10,12 +10,11 @@
Usage: deduplicator [OPTIONS]
Options:
-t, --types <TYPES> Filetypes to deduplicate (default = all)
-d, --delete <DELETE> Delete files by algorithm (default = oldest) [options = oldest | newest]
--dir <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 <TYPES> Filetypes to deduplicate (default = all)
--dir <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
```
<h2 align="center">Performance</h2>

View File

@@ -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 {