diff options
| author | Autumn | 2026-08-23 11:33:35 +0100 |
|---|---|---|
| committer | Autumn | 2026-08-23 11:33:35 +0100 |
| commit | 6337a8d398a223345e2e22ede0911d5e6dcab019 (patch) | |
| tree | 297121cbda8bf765d9d9cd64b1d31fd850882900 /main.ha | |
| parent | 47a3890c0055e04ffba2984f1870452cb1653435 (diff) | |
[bunnytask] added basic TODO.TXT reading
Diffstat (limited to 'main.ha')
| -rw-r--r-- | main.ha | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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); + }; +}; |
