feat: print complete default configuration from CLI

This commit is contained in:
2026-10-11 17:03:51 +02:00
parent 41e4a458cf
commit 35181634d6
6 changed files with 36 additions and 1 deletions
+4
View File
@@ -110,6 +110,10 @@ struct ConfigurationChecks {
let fallback = home.appendingPathComponent(".config/terebi/config.toml")
let config = xdg.appendingPathComponent("terebi/config.toml")
let defaults = PlayerConfiguration()
let printed = root.appendingPathComponent("printed-defaults.toml")
try Data(PlayerConfiguration.defaultTOML.utf8).write(to: printed)
try require(try PlayerConfiguration.load(from: printed) == defaults,
"printed TOML is directly usable and preserves all default behavior and bindings")
try require(!defaults.showBufferInfo && !defaults.automaticQuality && defaults.snapToEdges,
"built-in defaults hide buffer info, disable automatic quality, and enable snapping")
try require(PlayerConfiguration.fileURL(environment: ["XDG_CONFIG_HOME": xdg.path], homeDirectory: home) == config,