fn formatTerm(term: ?process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Error!void
fn formatTerm(term: ?process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Error!void { if (term) |t| switch (t) { .exited => |code| try w.print("exited with code {d}", .{code}), .signal => |sig| try w.print("terminated with signal {t}", .{sig}), .stopped => |sig| try w.print("stopped with signal {t}", .{sig}), .unknown => |code| try w.print("terminated for unknown reason with code {d}", .{code}), } else { try w.writeAll("exited with any code"); } }