aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst@digdash.com>2024-11-19 15:21:41 +0100
committerJulian Hurst <julian.hurst@digdash.com>2024-11-19 15:22:02 +0100
commit74210e1f8f16b2ea05c45e1f163f81ff6ab0cf95 (patch)
treefc8e83f0e8f3b29dfe3274401be7a473cd9c2bc2
parent9a0389bc5ac5b1d4a8c653951c21bb2e20d3f753 (diff)
downloadhatask-74210e1f8f16b2ea05c45e1f163f81ff6ab0cf95.tar.gz
show: print all if no args are specified
-rw-r--r--cmd.ha8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd.ha b/cmd.ha
index 2a1efe0..c836f50 100644
--- a/cmd.ha
+++ b/cmd.ha
@@ -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) {