diff options
Diffstat (limited to 'hatask.ha')
| -rw-r--r-- | hatask.ha | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -137,18 +137,20 @@ export fn main() void = { ); defer getopt::finish(&cmd); - let tasksdir: str = "tasks"; + const cfg: config = config { + tasksdir = "tasks", + }; for (let opt .. cmd.opts) { switch (opt.0) { case 'f' => - tasksdir = opt.1; + cfg.tasksdir = opt.1; case => abort(); }; }; - const tasks = match (listtasks(tasksdir)) { + const tasks = match (listtasks(cfg.tasksdir)) { case let e: fs::error => fmt::fatal(fs::strerror(e)); case let e: path::error => @@ -161,13 +163,13 @@ export fn main() void = { const com: (str, *getopt::command) = match (cmd.subcmd) { case void => - listall(tasks); + listall(cfg, tasks); return; case let subcmd: (str, *getopt::command) => yield (subcmd.0, subcmd.1); }; - match (execcommand(com.0, tasks, com.1)) { + match (execcommand(cfg, com.0, tasks, com.1)) { case let e: error => fmt::fatal(strerror(e)); case => |
