feat: add cli options to select color scheme

This commit is contained in:
CJ van den Berg 2025-09-30 15:29:19 +02:00
parent 8e4c428421
commit 1d509282f7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -83,6 +83,8 @@ pub fn main() anyerror!void {
.literal = "Disable :LINE and +LINE syntax",
.scratch = "Open a scratch (temporary) buffer on start",
.new_file = "Create a new untitled file on start",
.dark = "Use dark color scheme",
.light = "Use light color scheme",
.version = "Show build version and exit",
};
@ -121,6 +123,8 @@ pub fn main() anyerror!void {
literal: bool,
scratch: bool,
new_file: bool,
dark: bool,
light: bool,
version: bool,
positional: struct {
@ -346,6 +350,11 @@ pub fn main() anyerror!void {
try tui_proc.send(.{ "cmd", "create_scratch_buffer", .{} });
}
if (args.dark)
try tui_proc.send(.{ "cmd", "force_color_scheme", .{"dark"} })
else if (args.light)
try tui_proc.send(.{ "cmd", "force_color_scheme", .{"light"} });
if (args.exec) |exec_str| {
var cmds = std.mem.splitScalar(u8, exec_str, ';');
while (cmds.next()) |cmd| {