@@ -5,8 +5,8 @@ const AppContext = struct {
55 config_path : []const u8 ,
66};
77
8- pub fn main () anyerror ! void {
9- var gpa = std .heap .GeneralPurposeAllocator (.{}){} ;
8+ pub fn main (init : std.process.Init.Minimal ) anyerror ! void {
9+ var gpa : std .heap .DebugAllocator (.{}) = .init ;
1010 defer _ = gpa .deinit ();
1111 const allocator = gpa .allocator ();
1212
@@ -54,13 +54,17 @@ pub fn main() anyerror!void {
5454 .variadic = true ,
5555 });
5656
57- try root_command .run (& app_context );
57+ try root_command .run (init . args , & app_context );
5858}
5959
6060fn rootExec (ctx : chilli.CommandContext ) anyerror ! void {
6161 const app_ctx = ctx .getContextData (AppContext ).? ;
6262 const config_slice = try ctx .getFlag ("config" , []const u8 );
63- const stdout = std .fs .File .stdout ().deprecatedWriter ();
63+ const io = std .Options .debug_io ;
64+ var stdout_buf : [4096 ]u8 = undefined ;
65+ var stdout_fw = std .Io .File .stdout ().writer (io , & stdout_buf );
66+ defer stdout_fw .flush () catch {};
67+ const stdout = & stdout_fw .interface ;
6468
6569 if (app_ctx .config_path .len > 0 ) {
6670 ctx .app_allocator .free (app_ctx .config_path );
@@ -75,7 +79,11 @@ fn rootExec(ctx: chilli.CommandContext) anyerror!void {
7579fn runExec (ctx : chilli.CommandContext ) anyerror ! void {
7680 const task_name = try ctx .getArg ("task-name" , []const u8 );
7781 const files = ctx .getArgs ("files" );
78- const stdout = std .fs .File .stdout ().deprecatedWriter ();
82+ const io = std .Options .debug_io ;
83+ var stdout_buf : [4096 ]u8 = undefined ;
84+ var stdout_fw = std .Io .File .stdout ().writer (io , & stdout_buf );
85+ defer stdout_fw .flush () catch {};
86+ const stdout = & stdout_fw .interface ;
7987
8088 try stdout .print ("Running task '{s}'...\n " , .{task_name });
8189
0 commit comments