This commit is contained in:
jamesk 2024-03-18 18:20:57 -04:00
parent 86ff8d5575
commit 1456b67aa1
3 changed files with 43 additions and 4 deletions

24
src/comparemode.rs Normal file
View File

@ -0,0 +1,24 @@
use Fasching::hasher::HashType::BLAKE3;
use Fasching::snapshot::{Snapshot, SnapshotCompareResult};
use crate::syscompare::Comparer;
pub struct CompareMode {
left: Snapshot,
right: Snapshot,
args: Vec<String>,
results: SnapshotCompareResult
}
impl CompareMode {
pub fn new(args: Vec<String>, in_path: String, out_path: String) -> CompareMode {
CompareMode { in_path, out_path, args, snapshot: Default::default() }
}
}
impl Comparer for CompareMode {
fn run(&self) {
}
}

View File

@ -1,5 +1,6 @@
pub mod syscompare;
mod createmode;
pub mod createmode;
pub mod comparemode;
use std::env::args;
use crate::syscompare::{SysCompareApp};

View File

@ -26,16 +26,30 @@ impl SysCompareApp {
CompareMode::Create => {
let in_path = match self.args.get(2) {
None => {panic!("Missing hash dir path as second argument")}
Some(r) => {r}
Some(r) => {
if r.replace("./", "").is_empty() {
panic!("Specify input file name")
} else {
r
}
}
};
let out_path = match self.args.get(3) {
None => {panic!("Missing output path as third argument")}
Some(r) => {r}
Some(r) => {
if r.replace("./", "").is_empty() {
panic!("Specify out path file name")
} else {
r
}
}
};
let create = CreateMode::new(self.args.clone(), in_path.clone(), out_path.clone());
create.run()
}
CompareMode::Compare => {}
CompareMode::Compare => {
}
}
}
}