feat: zag CLI with all commands, human/JSON/XML output and e2e smoke test (M5)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel SamsonandClaude Sonnet 5.5 committed 2026-10-17 13:47:34 +01:00
1 parent 35106d405b
commit 9d08e4d3fd
13 files changed
+2147 -68

No files matched your search

+3 -3
View File
@@ -24,7 +24,7 @@ pub fn upperState(s: state_mod.State) []const u8 {
}
pub fn writeInstant(w: *jsonpretty.Writer, t: ?Instant) !void {
const v = t orelse return w.@"null"();
const v = t orelse return w.null();
var buf: [timestamp.max_len]u8 = undefined;
try w.string(timestamp.format(&buf, v));
}
@@ -50,11 +50,11 @@ pub fn writeJob(w: *jsonpretty.Writer, job: Job) !void {
if (job.exit_code) |c| switch (c) {
.code => |n| try w.int(n),
.symbol => |s| try w.string(s),
} else try w.@"null"();
} else try w.null();
try w.key("error");
try w.optString(job.err);
try w.key("pid");
if (job.pid) |p| try w.int(p) else try w.@"null"();
if (job.pid) |p| try w.int(p) else try w.null();
try w.key("heartbeat");
try writeInstant(w, job.heartbeat);
try w.field("retryCount", .int, job.retry_count);