diff options
| author | Julian Hurst <ark@mansus.space> | 2024-11-15 01:14:07 +0100 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2024-11-15 01:14:07 +0100 |
| commit | 1bea697f130b287c30e752d4a800e42a5263deb7 (patch) | |
| tree | 450ea401042b0d2e704ca2a7739b8e63249972e3 /hatask.ha | |
| parent | d3b66bb3920c3fad7c1513b0a99a6d16a6a53765 (diff) | |
| download | hatask-1bea697f130b287c30e752d4a800e42a5263deb7.tar.gz | |
Add -f flag to specify tasks directory
Diffstat (limited to 'hatask.ha')
| -rw-r--r-- | hatask.ha | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -123,6 +123,7 @@ fn sortname(a: const *opaque, b: const *opaque) int = { export fn main() void = { const cmd = getopt::parse(os::args, "tasklist", + ('f', "path", "tasks directory"), ("filter", ["filter tasks", "id"]: []getopt::help), ("f", ["filter tasks", "id"]: []getopt::help), ("show", ["show task details", "id"]: []getopt::help), @@ -136,8 +137,18 @@ export fn main() void = { ); defer getopt::finish(&cmd); + let tasksdir: str = "tasks"; + for (let opt .. cmd.opts) { + switch (opt.0) { + case 'f' => + tasksdir = opt.1; + case => + abort(); + }; + }; + - const tasks = match (listtasks()) { + const tasks = match (listtasks(tasksdir)) { case let e: fs::error => fmt::fatal(fs::strerror(e)); case let e: path::error => |
