From 9222d201d76d5b134d9014480520f649140563c3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 16 Jul 2025 11:40:21 -0700 Subject: [PATCH] add a happy little main function to src/fmt.zig Provided for debugging/testing purposes; unused by the compiler. --- src/fmt.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fmt.zig b/src/fmt.zig index 88c0e3a06f..7ac3018814 100644 --- a/src/fmt.zig +++ b/src/fmt.zig @@ -394,3 +394,12 @@ fn fmtPathFile( try stdout.print("{s}\n", .{file_path}); } } + +/// Provided for debugging/testing purposes; unused by the compiler. +pub fn main() !void { + const gpa = std.heap.smp_allocator; + var arena_instance = std.heap.ArenaAllocator.init(gpa); + const arena = arena_instance.allocator(); + const args = try process.argsAlloc(arena); + return run(gpa, arena, args[1..]); +}