mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-07-03 01:02:55 +00:00
Strip content that is included in system library
This commit is contained in:
@ -66,6 +66,11 @@ pub enum Command {
|
||||
help = "EXPERIMENTELL: Sortiere Kataloge und Formulare nach Name (Optional).\nKann negative Auswirkungen auf den ordnungsgemäßen Import haben."
|
||||
)]
|
||||
sorted: bool,
|
||||
#[arg(
|
||||
long = "x-strip",
|
||||
help = "EXPERIMENTELL: Entferne Einträge aus der Systembibliothek die nicht importiert werden (Optional).\nKann negative Auswirkungen auf den ordnungsgemäßen Import haben."
|
||||
)]
|
||||
strip: bool,
|
||||
},
|
||||
#[command(about = "Vergleiche zwei Dateien anhand der Revision der enthaltenen Inhalte")]
|
||||
Diff {
|
||||
|
@ -130,6 +130,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
outputfile,
|
||||
compact,
|
||||
sorted,
|
||||
strip,
|
||||
} => {
|
||||
let data = &mut read_inputfile(inputfile)?;
|
||||
|
||||
@ -144,6 +145,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
data.sorted();
|
||||
}
|
||||
|
||||
if strip {
|
||||
data.strip_system_library_content();
|
||||
}
|
||||
|
||||
let mut buf = String::new();
|
||||
|
||||
let mut serializer = Serializer::new(&mut buf);
|
||||
|
@ -172,6 +172,24 @@ impl OnkostarEditor {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn strip_system_library_content(&mut self) {
|
||||
self.editor
|
||||
.property_catalogue
|
||||
.retain(|e| !e.is_system_library_content());
|
||||
|
||||
self.editor
|
||||
.data_catalogue
|
||||
.retain(|e| !e.is_system_library_content());
|
||||
|
||||
self.editor
|
||||
.data_form
|
||||
.retain(|e| !e.is_system_library_content());
|
||||
|
||||
self.editor
|
||||
.unterformular
|
||||
.retain(|e| !e.is_system_library_content());
|
||||
}
|
||||
|
||||
pub fn print_diff(&mut self, other: &mut Self, strict: bool) {
|
||||
println!();
|
||||
|
||||
|
Reference in New Issue
Block a user