Port core:flags to os2

This commit is contained in:
Jeroen van Rijn
2025-11-02 11:26:22 +01:00
parent 1778b8842a
commit 2afd51cf63
6 changed files with 59 additions and 57 deletions

View File

@@ -4,7 +4,7 @@ import "base:runtime"
import "core:flags"
import "core:fmt"
import "core:net"
import "core:os"
import os "core:os/os2"
import "core:time/datetime"
@@ -76,8 +76,8 @@ Distinct_Int :: distinct int
main :: proc() {
Options :: struct {
file: os.Handle `args:"pos=0,required,file=r" usage:"Input file."`,
output: os.Handle `args:"pos=1,file=cw" usage:"Output file."`,
file: ^os.File `args:"pos=0,required,file=r" usage:"Input file."`,
output: ^os.File `args:"pos=1,file=cw" usage:"Output file."`,
hub: net.Host_Or_Endpoint `usage:"Internet address to contact for updates."`,
schedule: datetime.DateTime `usage:"Launch tasks at this time."`,
@@ -126,7 +126,7 @@ main :: proc() {
fmt.printfln("%#v", opt)
if opt.output != 0 {
if opt.output != nil {
os.write_string(opt.output, "Hellope!\n")
}
}