refactor: document available idle actions in config file

This commit is contained in:
CJ van den Berg 2026-01-14 13:58:53 +01:00
parent 12c4d507b4
commit 77946e51f6
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -759,10 +759,15 @@ fn write_config_value_description(T: type, field_type: type, writer: *std.Io.Wri
try writer.print("quoted string (u16)", .{}) try writer.print("quoted string (u16)", .{})
else if (info.child == []const u8) else if (info.child == []const u8)
try writer.print("list of quoted strings", .{}) try writer.print("list of quoted strings", .{})
else if (info.child == @import("config").IdleAction) else if (info.child == @import("config").IdleAction) {
try writer.print("list of idle actions", .{}) try writer.print("list of idle actions (available actions: ", .{});
else var first = true;
unsupported_error(T, info.child), for (std.meta.tags(@import("config").IdleAction)) |tag| {
if (first) first = false else try writer.print(", ", .{});
try writer.print("\"{t}\"", .{tag});
}
try writer.print(")", .{});
} else unsupported_error(T, info.child),
else => unsupported_error(T, info.child), else => unsupported_error(T, info.child),
}, },
else => unsupported_error(T, field_type), else => unsupported_error(T, field_type),