feat: preprocess native argv into sentinel slices

This commit is contained in:
2026-10-23 12:07:23 +02:00
parent eddca5c3bf
commit 8ebbf72388
8 changed files with 167 additions and 93 deletions
+1 -17
View File
@@ -6,21 +6,5 @@ Init :: struct {
}
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]
values [][;0]u8
}