mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-04-20 20:26:50 +00:00
Experimental sort of exported content
This commit is contained in:
parent
ad35b99371
commit
376bfb2852
@ -58,6 +58,13 @@ Hierzu ist die Option `--compact` vorgesehen. Es können, je nach Datei, bis zu
|
|||||||
Bei der Auflistung der Inhalte, kann die Option `--sorted` dazu verwendet werden, die angezeigten Einträge alphabetisch zu sortieren.
|
Bei der Auflistung der Inhalte, kann die Option `--sorted` dazu verwendet werden, die angezeigten Einträge alphabetisch zu sortieren.
|
||||||
Die Sortierung erfolgt dabei nach Namen des Katalogs oder des Formulars.
|
Die Sortierung erfolgt dabei nach Namen des Katalogs oder des Formulars.
|
||||||
|
|
||||||
|
##### Experimentell: Sortierung nach Modifikation
|
||||||
|
|
||||||
|
Beim Modifizieren der Inhalte kann die experimentelle Option `--x-sorted` dazu verwendet werden, die Einträge im Anschluss an die Modifikation
|
||||||
|
nach Namen zu sortieren.
|
||||||
|
Dies erlaubt eine konsistente Reihenfolge der Einträge, wodurch ein direkter Vergleich mit Vorversionen ermöglicht wird.
|
||||||
|
ACHTUNG: Es kann sein, dass dadurch ein Import der resultierenden OSC-Datei nicht mehr möglich ist, da das genaue Verhalten des Imports aktuell noch nicht bekannt ist.
|
||||||
|
|
||||||
## Profile
|
## Profile
|
||||||
|
|
||||||
Zum Erstellen von Varianten einer OSC-Datei wird eine Profildatei im YAML-Format verwendet.
|
Zum Erstellen von Varianten einer OSC-Datei wird eine Profildatei im YAML-Format verwendet.
|
||||||
|
@ -52,6 +52,11 @@ pub enum Command {
|
|||||||
outputfile: Option<String>,
|
outputfile: Option<String>,
|
||||||
#[arg(long = "compact", help = "Kompakte Ausgabe, ohne Einrücken (Optional)")]
|
#[arg(long = "compact", help = "Kompakte Ausgabe, ohne Einrücken (Optional)")]
|
||||||
compact: bool,
|
compact: bool,
|
||||||
|
#[arg(
|
||||||
|
long = "x-sorted",
|
||||||
|
help = "EXPERIMENTELL: Sortiere Kataloge und Formulare nach Name (Optional). Kann negative Auswirkungen auf den ordnungsgemäßen Import haben."
|
||||||
|
)]
|
||||||
|
sorted: bool,
|
||||||
},
|
},
|
||||||
#[command(about = "Vergleiche zwei Dateien anhand der Revision der enthaltenen Inhalte")]
|
#[command(about = "Vergleiche zwei Dateien anhand der Revision der enthaltenen Inhalte")]
|
||||||
Diff {
|
Diff {
|
||||||
|
@ -122,6 +122,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
profile,
|
profile,
|
||||||
outputfile,
|
outputfile,
|
||||||
compact,
|
compact,
|
||||||
|
sorted,
|
||||||
} => {
|
} => {
|
||||||
let data = &mut read_inputfile(inputfile)?;
|
let data = &mut read_inputfile(inputfile)?;
|
||||||
|
|
||||||
@ -132,6 +133,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
data.apply_profile(&profile);
|
data.apply_profile(&profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sorted {
|
||||||
|
data.sorted();
|
||||||
|
}
|
||||||
|
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
|
|
||||||
let mut serializer = Serializer::new(&mut buf);
|
let mut serializer = Serializer::new(&mut buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user