diff --git a/README.md b/README.md index cbc5a5b..466277f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ Ohne Profildatei wird die Datei lediglich eingelesen, Leerzeichen am Ende eines Ohne eine Angabe der Ausgabedatei wird auf die Standardausgabe ausgegeben. +#### Kompakte Ausgabe + +OSC-Dateien sind XML-Dateien. Diese Anwendung ermöglicht optional die Ausgabe als kompaktere XML-Datei ohne Zeilenumbrüche. +Hierzu ist die Option `--compact` vorgesehen. Es können, je nach Datei, bis zu 30% eingespart werden. + ## Profile Zum Erstellen von Varianten einer OSC-Datei wird eine Profildatei im YAML-Format verwendet. @@ -72,4 +77,4 @@ Wird sie angeben, sind die Felder `name`, `position` und `column` verpflichtend. Es können beliebig viele Formulare mit beliebig vielen Änderungen zu Formularverweisen in einer Profildatei hinterlegt werden, jedoch ist mindestens eine Angabe zu einem Formularfeld erforderlich. -Beispiele für eine Profildatei sind unter [`examples/`](examples/) zu finden. +Beispiele für eine Profildatei sind unter [`examples/`](examples/) zu finden. diff --git a/src/cli.rs b/src/cli.rs index e057d6f..2e05b72 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -39,9 +39,11 @@ pub enum Command { #[command(about = "Modifiziert die angegebene Datei anhand der Profildatei")] Modify { inputfile: String, - #[arg(long = "profile", help = "Profildatei (Optional)")] + #[arg(long = "profile", help = "Profildatei (optional)")] profile: Option, - #[arg(long = "output", help = "Ausgabedatei (Optional)")] + #[arg(long = "output", help = "Ausgabedatei (optional)")] outputfile: Option, + #[arg(long = "compact", help = "Kompakte Ausgabe, ohne Einrücken (Optional)")] + compact: bool, }, } diff --git a/src/main.rs b/src/main.rs index 335df16..0fc8974 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,6 +117,7 @@ fn main() -> Result<(), Box> { inputfile, profile, outputfile, + compact, } => { let data = &mut read_inputfile(inputfile)?; @@ -130,7 +131,9 @@ fn main() -> Result<(), Box> { 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");