Couple cli and shell

This commit is contained in:
Hugo Mårdbrink 2025-08-13 16:18:20 +02:00
parent a3e9ee9807
commit 275e5c3f7d
3 changed files with 142 additions and 135 deletions

View file

@ -26,16 +26,23 @@ main :: proc() {
shell.init_shell()
cli.init_cli()
defer cli.deinit_cli()
for true {
input := cli.run_prompt()
defer free_all(context.temp_allocator)
maybe_input := cli.run_prompt()
input, ok := maybe_input.?
if !ok {
fmt.println()
break
}
cmd_seq, parser_err := parser.parse(input)
log.assertf(parser_err == nil, "Could not parse input")
stop := shell.execute(&cmd_seq)
free_all(context.temp_allocator)
if stop == .Stop do break
}
}