feat: supply process arguments through native startup

This commit is contained in:
2026-10-23 11:37:30 +02:00
parent 8ab5b71a0c
commit eddca5c3bf
6 changed files with 306 additions and 25 deletions
+21
View File
@@ -2,4 +2,25 @@ import "@std/io"
Init :: struct {
io io.Io
args Args
}
Args :: struct {
values [][*;0]u8
}
argument_count func(args Args) usize {
return args.values.len
}
argument func(args Args, index usize) ?[;0]u8 {
if index >= argument_count(args) {
return null
}
pointer :: args.values[index]
length usize := 0
while pointer[length] != 0 {
length += 1
}
return pointer[..length;0]
}