diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exec.zig b/src/exec.zig index 215a4fd1..c673aab2 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -1015,12 +1015,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}", .{refused}) catch "Shell: no such shell"); } } - if (!p.settings.apply(setting, want) and p.announce) p.reportFailure(p.active, "Shell: does not take that value"); + if (!p.settings.apply(setting, want) and p.announce) p.reportFailure(p.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); }, + // Said with what it takes: its words, its range. else => if (!p.settings.apply(setting, arg) and p.announce) { - var text: [96]u8 = undefined; - const takes = if (setting.action == .toggle) "takes on or off" else "does not take that value"; - p.reportFailure(p.active, std.fmt.bufPrint(&text, "{s}: {s}", .{ setting.word, takes }) catch takes); + var text: [160]u8 = undefined; + const why = if (config.Runtime.takes(setting.action)) |values| std.fmt.bufPrint(&text, "{s}: takes {s}", .{ setting.word, values }) else std.fmt.bufPrint(&text, "{s}: does not take that value", .{setting.word}); + p.reportFailure(p.active, why catch "does not take that value"); }, } if (p.settings.colors != previous_colors) { |
