diff options
| author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2024-10-15 14:45:49 -0500 |
|---|---|---|
| committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2024-10-15 14:48:34 -0500 |
| commit | f645d6962b23f4d6bd69bec2055d8ac612eabbee (patch) | |
| tree | 683205f2586325f57f4d1bf3668a9775f53f49cb /src/cli | |
| parent | 4c871246dd561423e69eb9faef5946747f44eac8 (diff) | |
cli: add GTK & libadwaita version info
If the apprt is GTK add the GTK and the libadwaita version info to the
`+version` action. This information is available in the log but it may
be more accessible here.
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/version.zig | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cli/version.zig b/src/cli/version.zig index cb6cf36de..6212b1743 100644 --- a/src/cli/version.zig +++ b/src/cli/version.zig @@ -1,9 +1,11 @@ const std = @import("std"); +const build_options = @import("build_options"); const Allocator = std.mem.Allocator; const builtin = @import("builtin"); const build_config = @import("../build_config.zig"); const xev = @import("xev"); const renderer = @import("../renderer.zig"); +const gtk = if (build_config.app_runtime == .gtk) @import("../apprt/gtk/c.zig").c else void; /// The `version` command is used to display information about Ghostty. pub fn run(alloc: Allocator) !u8 { @@ -28,5 +30,31 @@ pub fn run(alloc: Allocator) !u8 { try stdout.print(" - font engine: {}\n", .{build_config.font_backend}); try stdout.print(" - renderer : {}\n", .{renderer.Renderer}); try stdout.print(" - libxev : {}\n", .{xev.backend}); + if (comptime build_config.app_runtime == .gtk) { + try stdout.print(" - GTK version:\n", .{}); + try stdout.print(" build : {d}.{d}.{d}\n", .{ + gtk.GTK_MAJOR_VERSION, + gtk.GTK_MINOR_VERSION, + gtk.GTK_MICRO_VERSION, + }); + try stdout.print(" runtime : {d}.{d}.{d}\n", .{ + gtk.gtk_get_major_version(), + gtk.gtk_get_minor_version(), + gtk.gtk_get_micro_version(), + }); + if (comptime build_options.libadwaita) { + try stdout.print(" - libadwaita : enabled\n", .{}); + try stdout.print(" build : {s}\n", .{ + gtk.ADW_VERSION_S, + }); + try stdout.print(" runtime : {}.{}.{}\n", .{ + gtk.adw_get_major_version(), + gtk.adw_get_minor_version(), + gtk.adw_get_micro_version(), + }); + } else { + try stdout.print(" - libadwaita : disabled\n", .{}); + } + } return 0; } |
