Add 'compact' option to get smaller output files

This commit is contained in:
2023-06-07 10:55:55 +02:00
parent aa610a0593
commit ea135010d2
3 changed files with 14 additions and 4 deletions

View File

@@ -117,6 +117,7 @@ fn main() -> Result<(), Box<dyn Error>> {
inputfile,
profile,
outputfile,
compact,
} => {
let data = &mut read_inputfile(inputfile)?;
@@ -130,7 +131,9 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut buf = String::new();
let mut serializer = Serializer::new(&mut buf);
serializer.indent(' ', 2);
if !compact {
serializer.indent(' ', 2);
}
data.serialize(serializer).expect("Generated XML");