From be3fc5c04a21109538adc7354bc6cbc571b4e6e3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 18 Oct 2024 08:26:17 -0700 Subject: [PATCH] apprt/gtk: exit if there are CLI errors --- src/apprt/gtk/App.zig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 6c17e3d3e..10a2bdc02 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -131,6 +131,12 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { log.warn("configuration error: {s}", .{buf.items}); buf.clearRetainingCapacity(); } + + // If we have any CLI errors, exit. + if (config._diagnostics.containsLocation(.cli)) { + log.warn("CLI errors detected, exiting", .{}); + std.posix.exit(1); + } } c.gtk_init(); @@ -1368,10 +1374,7 @@ fn gtkActionQuit( ud: ?*anyopaque, ) callconv(.C) void { const self: *App = @ptrCast(@alignCast(ud orelse return)); - self.core_app.setQuit() catch |err| { - log.warn("error setting quit err={}", .{err}); - return; - }; + self.core_app.setQuit(); } /// Action sent by the window manager asking us to present a specific surface to