From 6337a8d398a223345e2e22ede0911d5e6dcab019 Mon Sep 17 00:00:00 2001 From: Autumn Date: Sun, 23 Aug 2026 11:33:35 +0100 Subject: [bunnytask] added basic TODO.TXT reading --- main.ha | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main.ha (limited to 'main.ha') diff --git a/main.ha b/main.ha new file mode 100644 index 0000000..995d5d4 --- /dev/null +++ b/main.ha @@ -0,0 +1,20 @@ +use fmt; +use strings; +use todo; +use fs; + +def TODO_FILE = "todo.txt"; + +export fn main() void = { + const todos = match(todo::open(TODO_FILE)) { + case let todos: []str => yield todos; + case let err: fs::error => fmt::fatalf("Error opening {}: {}", TODO_FILE, fs::strerror(err)); + }; + defer strings::freeall(todos); + + fmt::println("To-dos:")!; + + for (let item .. todos) { + if (item != "") todo::print(item); + }; +}; -- cgit v1.3