init
This commit is contained in:
parent
86ff8d5575
commit
1456b67aa1
24
src/comparemode.rs
Normal file
24
src/comparemode.rs
Normal 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
pub mod syscompare;
|
pub mod syscompare;
|
||||||
mod createmode;
|
pub mod createmode;
|
||||||
|
pub mod comparemode;
|
||||||
|
|
||||||
use std::env::args;
|
use std::env::args;
|
||||||
use crate::syscompare::{SysCompareApp};
|
use crate::syscompare::{SysCompareApp};
|
||||||
|
@ -26,16 +26,30 @@ impl SysCompareApp {
|
|||||||
CompareMode::Create => {
|
CompareMode::Create => {
|
||||||
let in_path = match self.args.get(2) {
|
let in_path = match self.args.get(2) {
|
||||||
None => {panic!("Missing hash dir path as second argument")}
|
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) {
|
let out_path = match self.args.get(3) {
|
||||||
None => {panic!("Missing output path as third argument")}
|
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());
|
let create = CreateMode::new(self.args.clone(), in_path.clone(), out_path.clone());
|
||||||
create.run()
|
create.run()
|
||||||
}
|
}
|
||||||
CompareMode::Compare => {}
|
CompareMode::Compare => {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user