summaryrefslogtreecommitdiff
path: root/Omni/Jr.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-26 13:25:07 -0500
committerBen Sima <ben@bensima.com>2025-11-26 13:25:07 -0500
commit9ac32389934012a7d33339ea81ae6a6c7c34b2c0 (patch)
treea3a50b0df112a6933bd682ab17e879e1fc1d2545 /Omni/Jr.hs
parentd6b4251da41215e88462c8798b59baea2217a0bf (diff)
Port task commands to jr task
All tests pass. The task is complete: - ✅ `jr task list` works - ✅ `jr task create` works - ✅ `jr task show` works - ✅ All Omni/Task commands accessible via `jr task` - ✅ Reuses Omni.Task logic - ✅ Added tests for task command parsing - ✅ `bild --test Omni/Jr.hs` passes Task-Id: t-1o2egbj8o0n.2
Diffstat (limited to 'Omni/Jr.hs')
-rw-r--r--Omni/Jr.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Omni/Jr.hs b/Omni/Jr.hs
index 8636e54..8200be5 100644
--- a/Omni/Jr.hs
+++ b/Omni/Jr.hs
@@ -398,6 +398,18 @@ test =
Test.group
"Omni.Jr"
[ Test.unit "can run tests" <| True Test.@?= True,
+ Test.unit "can parse task command" <| do
+ let result = Docopt.parseArgs help ["task"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'task': " <> show err
+ Right args -> args `Cli.has` Cli.command "task" Test.@?= True,
+ Test.unit "can parse task command with args" <| do
+ let result = Docopt.parseArgs help ["task", "list", "--json"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'task list --json': " <> show err
+ Right args -> do
+ args `Cli.has` Cli.command "task" Test.@?= True
+ Cli.getAllArgs args (Cli.argument "args") Test.@?= ["list", "--json"],
Test.unit "can parse work command" <| do
let result = Docopt.parseArgs help ["work"]
case result of