summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config.zig b/src/config.zig
index a7377cfa..a17e2fd2 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -1242,6 +1242,22 @@ pub const Runtime = struct {
};
}
+ /// What a setting takes, for a refusal of a bad value to name: its
+ /// words (`choices`), else its range or the kind of thing it takes.
+ pub fn takes(action: Action) ?[]const u8 {
+ return choices(action) orelse switch (action) {
+ .inactive_dim, .window_opacity, .window_blur => "0-100 (a percentage)",
+ .grip_width => "50-300 (a percentage)",
+ .tagline_size => std.fmt.comptimePrint("{d}-{d} (a percentage)", .{ tagline_percent_min, tagline_percent_max }),
+ .message_ms => std.fmt.comptimePrint("0-{d} (milliseconds)", .{message_ms_max}),
+ .shell => "a path of at most 255 bytes; bare, the login shell",
+ .dump_dir => std.fmt.comptimePrint("a path of at most {d} bytes; bare, the default", .{limits.host_path_cap}),
+ .shader => "a Shadertoy file's path, or off",
+ .font => "a name or path, :8 to :72 after it (Mono:14)",
+ else => null,
+ };
+ }
+
/// The value a choice word names, or bare, the one after `now`; null for
/// a word it does not take.
fn stepped(comptime T: type, now: T, argument: ?[]const u8) ?T {