cli: add +show-face CLI action

This CLI action shows what font face Ghostty will use to display
a particular codepoint.
This commit is contained in:
Jeffrey C. Ollie
2024-12-17 13:09:32 -06:00
parent 813c48cb12
commit 82e67430cd
2 changed files with 230 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ const list_actions = @import("list_actions.zig");
const show_config = @import("show_config.zig");
const validate_config = @import("validate_config.zig");
const crash_report = @import("crash_report.zig");
const show_face = @import("show_face.zig");
/// Special commands that can be invoked via CLI flags. These are all
/// invoked by using `+<action>` as a CLI flag. The only exception is
@@ -47,6 +48,9 @@ pub const Action = enum {
// List, (eventually) view, and (eventually) send crash reports.
@"crash-report",
// Show which font face Ghostty loads a codepoint from.
@"show-face",
pub const Error = error{
/// Multiple actions were detected. You can specify at most one
/// action on the CLI otherwise the behavior desired is ambiguous.
@@ -146,6 +150,7 @@ pub const Action = enum {
.@"show-config" => try show_config.run(alloc),
.@"validate-config" => try validate_config.run(alloc),
.@"crash-report" => try crash_report.run(alloc),
.@"show-face" => try show_face.run(alloc),
};
}
@@ -180,6 +185,7 @@ pub const Action = enum {
.@"show-config" => show_config.Options,
.@"validate-config" => validate_config.Options,
.@"crash-report" => crash_report.Options,
.@"show-face" => show_face.Options,
};
}
}