Add subcommand 'diff' to compare two OSC files

This commit is contained in:
2023-07-01 17:29:53 +02:00
parent b04ee563f2
commit b030ce6a53
9 changed files with 209 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ use std::ops::Add;
use std::str::FromStr;
use clap::Parser;
use console::style;
use quick_xml::se::Serializer;
use serde::Serialize;
@@ -157,6 +158,22 @@ fn main() -> Result<(), Box<dyn Error>> {
}
}
}
Command::Diff {
inputfile_a,
inputfile_b,
strict,
} => {
println!(
"Vergleiche Datei A ({}) mit Datei B ({})",
style(&inputfile_a).yellow(),
style(&inputfile_b).yellow()
);
let data_a = &mut read_inputfile(inputfile_a)?;
let data_b = &mut read_inputfile(inputfile_b)?;
data_a.print_diff(data_b, strict);
}
};
Ok(())