feat: basic +crash-report cli action

Only lists crash reports right now. Viewing and/or submitting crash
reports to come later.
This commit is contained in:
Jeffrey C. Ollie
2024-09-02 15:07:36 -05:00
committed by Mitchell Hashimoto
parent 67abd8804e
commit d907cebae9
4 changed files with 138 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ const list_colors = @import("list_colors.zig");
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");
/// Special commands that can be invoked via CLI flags. These are all
/// invoked by using `+<action>` as a CLI flag. The only exception is
@@ -43,6 +44,9 @@ pub const Action = enum {
// Validate passed config file
@"validate-config",
// List, (eventually) view, and (eventually) send crash reports.
@"crash-report",
pub const Error = error{
/// Multiple actions were detected. You can specify at most one
/// action on the CLI otherwise the behavior desired is ambiguous.
@@ -134,6 +138,7 @@ pub const Action = enum {
.@"list-actions" => try list_actions.run(alloc),
.@"show-config" => try show_config.run(alloc),
.@"validate-config" => try validate_config.run(alloc),
.@"crash-report" => try crash_report.run(alloc),
};
}