feat(actions): add new list-keybinds action

This commit is contained in:
Raiden1411
2023-11-02 21:34:14 +00:00
parent cc6985d62d
commit 59daecc304
2 changed files with 110 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ const Allocator = std.mem.Allocator;
const list_fonts = @import("list_fonts.zig");
const version = @import("version.zig");
const list_keybinds = @import("list_keybinds.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
@@ -14,6 +15,9 @@ pub const Action = enum {
/// List available fonts
@"list-fonts",
/// List available keybinds
@"list-keybinds",
pub const Error = error{
/// Multiple actions were detected. You can specify at most one
/// action on the CLI otherwise the behavior desired is ambiguous.
@@ -52,6 +56,7 @@ pub const Action = enum {
return switch (self) {
.version => try version.run(),
.@"list-fonts" => try list_fonts.run(alloc),
.@"list-keybinds" => try list_keybinds.run(alloc),
};
}
};