diff options
| author | Julian Hurst <julian.hurst@digdash.com> | 2024-11-19 15:21:41 +0100 |
|---|---|---|
| committer | Julian Hurst <julian.hurst@digdash.com> | 2024-11-19 15:22:02 +0100 |
| commit | 74210e1f8f16b2ea05c45e1f163f81ff6ab0cf95 (patch) | |
| tree | fc8e83f0e8f3b29dfe3274401be7a473cd9c2bc2 /cmd.ha | |
| parent | 9a0389bc5ac5b1d4a8c653951c21bb2e20d3f753 (diff) | |
| download | hatask-74210e1f8f16b2ea05c45e1f163f81ff6ab0cf95.tar.gz | |
show: print all if no args are specified
Diffstat (limited to 'cmd.ha')
| -rw-r--r-- | cmd.ha | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -90,6 +90,14 @@ fn write(cfg: config, tasks: []task, a: arguments) (void | task | error) = { fn show(cfg: config, tasks: []task, a: arguments) (void | task | error) = { const args = a.args; + // if no args, print all + if (len(args) == 0) { + for (const t .. tasks) { + fmt::println(t.content)!; + }; + return; + }; + for (const arg .. args) { const id = strconv::stoz(arg)?; const t = if (len(tasks) > id) { |
