summaryrefslogtreecommitdiff
path: root/src/cli.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2024-10-16 16:45:38 -0700
committerMitchell Hashimoto <m@mitchellh.com>2024-10-18 08:11:11 -0700
commita4e14631ef6eb57382ff3c15134d90617c8fd264 (patch)
tree2e407580ccdae9e7aa1568fc0b2039fb7315b74b /src/cli.zig
parent3f1d6eb301a7fb3d967c7f17c555c8dd761d900c (diff)
config: richer diagnostics for errors
Rather than storing a list of errors we now store a list of "diagnostics." Each diagnostic has a richer set of structured information, including a message, a key, the location where it occurred. This lets us show more detailed messages, more human friendly messages, and also let's us filter by key or location. We don't take advantage of all of this capability in this initial commit, but we do use every field for something.
Diffstat (limited to 'src/cli.zig')
-rw-r--r--src/cli.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cli.zig b/src/cli.zig
index 871060b02..52527e21b 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -1,5 +1,10 @@
+const diags = @import("cli/diagnostics.zig");
+
pub const args = @import("cli/args.zig");
pub const Action = @import("cli/action.zig").Action;
+pub const DiagnosticList = diags.DiagnosticList;
+pub const Diagnostic = diags.Diagnostic;
+pub const Location = diags.Diagnostic.Location;
test {
@import("std").testing.refAllDecls(@This());