mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 13:32:44 +00:00
`--export-settings` already writes the merged config as JSON at the right point in the CLI flow. Passing `-` now writes that same document to stdout, so scripts can inspect the effective config without a temp file. This replaces #14605. - `ConfigBase::save_to_json` gains a stream overload. The file overload serializes through it before opening the file, so the output format is unchanged, and a config that cannot be serialized (invalid UTF-8) now leaves the existing file untouched instead of truncating it. - On stdout, invalid UTF-8 in string values is written as U+FFFD instead of ending the process with an uncaught `type_error`. Files keep the strict behaviour. - To keep stdout pure JSON, `-` is rejected up front (stderr message, `CLI_INVALID_PARAMS`, shell status 254) when combined with an action or transform that can write to stdout or does real work: `--info`, `--help`, `--orient`, slicing and exporting. Options that do nothing without a slice (`--uptodate`, `--min-save`, `--pipe`, ...) are still accepted. - The one unconditional stdout write on a success path, "skip locked instance" during arrange, now goes to the log. - Every other value, including the default `output.json`, behaves as before. Tests in `tests/libslic3r/test_config.cpp`: the stream output equals the file output and keeps the tab-indented format; invalid UTF-8 throws on the strict path and is replaced when asked; a failed save leaves the previous file intact.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: