Restructuring

Add a bunch of tests for the client
This commit is contained in:
2026-01-06 18:45:17 -05:00
parent 025a5344c8
commit b87412ee66
6 changed files with 124 additions and 110 deletions

View File

@@ -6,6 +6,8 @@ const yazap = @import("yazap");
const Message = zits.MessageParser.Message;
const Server = zits.Server;
const serverSubcommand = @import("./subcommand/server.zig").main;
pub fn main() !void {
var dba: std.heap.DebugAllocator(.{}) = .init;
defer _ = dba.deinit();
@@ -67,7 +69,7 @@ pub fn main() !void {
info.server_name = name;
}
try @import("./server/main.zig").main(gpa, info);
try serverSubcommand(gpa, info);
return;
} else if (matches.subcommandMatches("pub")) |_| {
std.debug.print("Unimplemented\n", .{});
@@ -76,3 +78,25 @@ pub fn main() !void {
try app.displayHelp(io);
}
pub const std_options: std.Options = .{
// By default, in safe build modes, the standard library will attach a segfault handler to the program to
// print a helpful stack trace if a segmentation fault occurs. Here, we can disable this, or even enable
// it in unsafe build modes.
.enable_segfault_handler = true,
// This is the logging function used by `std.log`.
.logFn = myLogFn,
};
fn myLogFn(
comptime level: std.log.Level,
comptime scope: @EnumLiteral(),
comptime format: []const u8,
args: anytype,
) void {
if (scope == .zits) {
std.log.defaultLog(level, std.log.default_log_scope, format, args);
} else {
std.log.defaultLog(level, scope, format, args);
}
}