Pass arguments to main via runtime.process.Init, dispatched on signature

This commit is contained in:
Daniel Samson
2026-07-11 14:22:48 +01:00
parent d218d93f79
commit 75ccfff171
6 changed files with 112 additions and 39 deletions
@@ -48,10 +48,8 @@ fn awaitChildExit(endpoint: runtime.ipc.Handle) u32 {
return received.childProcessId();
}
pub fn main() void {
if (runtime.argumentCount() <= 1) return; // spawned bare (ramdisk sweep): stay silent
const role = runtime.argument(1);
pub fn main(init: runtime.process.Init) void {
const role = init.arguments.get(1) orelse return; // spawned bare (ramdisk sweep): stay silent
if (std.mem.eql(u8, role, "sleeper")) {
while (true) runtime.system.sleep(500);
}