mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-09-14 09:36:34 +00:00
v0.3 (#61)
- [x] parallelization
- [x] (scanning) + (processing sw & processing hw & formatting & printing)
- [x] reduce cloning values on the heap
- [x] add a partial hashing mode (--strict)
- [x] add unit tests
- [x] add silent mode
- [x] update documentation
- [x] remove color output
- [x] progress bar improvements
- [x] use progress bar groups
- [x] remove broken json rendering
- [x] add benchmarks
This commit is contained in:
committed by
GitHub
parent
f9e86f8522
commit
58e33cc8da
28
src/main.rs
28
src/main.rs
@@ -4,28 +4,32 @@ mod interactive;
|
||||
mod params;
|
||||
mod processor;
|
||||
mod scanner;
|
||||
mod server;
|
||||
|
||||
use self::{formatter::Formatter, interactive::Interactive, server::Server};
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use formatter::Formatter;
|
||||
use params::Params;
|
||||
use processor::Processor;
|
||||
use scanner::Scanner;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let app_args = Params::parse();
|
||||
let scan_results = Scanner::build(&app_args)?.scan()?;
|
||||
let mut processor = Processor::new(scan_results);
|
||||
let server = Server::new(app_args.clone());
|
||||
|
||||
processor.sizewise()?;
|
||||
processor.hashwise()?;
|
||||
|
||||
let results = processor.hashwise_results;
|
||||
server.start()?;
|
||||
|
||||
match app_args.interactive {
|
||||
false => Formatter::print(results, processor.max_path_len, &app_args)?,
|
||||
true => interactive::init(results, &app_args)?,
|
||||
}
|
||||
false => {
|
||||
Formatter::print(
|
||||
server.hw_duplicate_set,
|
||||
server.max_file_path_len.load(Ordering::Acquire),
|
||||
&app_args,
|
||||
)?;
|
||||
}
|
||||
true => {
|
||||
Interactive::init(server.hw_duplicate_set, &app_args)?;
|
||||
}
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user