summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs26
1 files changed, 22 insertions, 4 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 36b318b..10313a7 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -4,6 +4,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- : out task
+-- : modified by benign worker
module Omni.Task where
import Alpha
@@ -76,7 +77,7 @@ Options:
--type=<type> Task type: epic or task (default: task)
--parent=<id> Parent epic ID
--priority=<p> Priority: 0-4 (0=critical, 4=backlog, default: 2)
- --status=<status> Filter by status: open, in-progress, review, done
+ --status=<status> Filter by status: open, in-progress, review, approved, done
--epic=<id> Filter stats by epic (recursive)
--deps=<ids> Comma-separated list of dependency IDs
--dep-type=<type> Dependency type: blocks, discovered-from, parent-child, related (default: blocks)
@@ -91,7 +92,7 @@ Options:
Arguments:
<title> Task title
<id> Task ID
- <status> Task status (open, in-progress, review, done)
+ <status> Task status (open, in-progress, review, approved, done)
<file> JSONL file to import
|]
@@ -183,8 +184,9 @@ move args
Just "open" -> pure <| Just Open
Just "in-progress" -> pure <| Just InProgress
Just "review" -> pure <| Just Review
+ Just "approved" -> pure <| Just Approved
Just "done" -> pure <| Just Done
- Just other -> panic <| "Invalid status: " <> T.pack other <> ". Use: open, in-progress, review, or done"
+ Just other -> panic <| "Invalid status: " <> T.pack other <> ". Use: open, in-progress, review, approved, or done"
maybeNamespace <- case Cli.getArg args (Cli.longOption "namespace") of
Nothing -> pure Nothing
Just ns -> do
@@ -218,8 +220,9 @@ move args
"open" -> Open
"in-progress" -> InProgress
"review" -> Review
+ "approved" -> Approved
"done" -> Done
- _ -> panic "Invalid status. Use: open, in-progress, review, or done"
+ _ -> panic "Invalid status. Use: open, in-progress, review, approved, or done"
updateTaskStatus tid newStatus
if isJsonMode args
then outputSuccess <| "Updated task " <> tid
@@ -471,6 +474,13 @@ cliTests =
Right args -> do
args `Cli.has` Cli.command "list" Test.@?= True
Cli.getArg args (Cli.longOption "status") Test.@?= Just "open",
+ Test.unit "list with --status=approved filter" <| do
+ let result = Docopt.parseArgs help ["list", "--status=approved"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'list --status=approved': " <> show err
+ Right args -> do
+ args `Cli.has` Cli.command "list" Test.@?= True
+ Cli.getArg args (Cli.longOption "status") Test.@?= Just "approved",
Test.unit "ready command" <| do
let result = Docopt.parseArgs help ["ready"]
case result of
@@ -491,6 +501,14 @@ cliTests =
args `Cli.has` Cli.command "update" Test.@?= True
Cli.getArg args (Cli.argument "id") Test.@?= Just "t-abc123"
Cli.getArg args (Cli.argument "status") Test.@?= Just "done",
+ Test.unit "update command with approved" <| do
+ let result = Docopt.parseArgs help ["update", "t-abc123", "approved"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'update ... approved': " <> show err
+ Right args -> do
+ args `Cli.has` Cli.command "update" Test.@?= True
+ Cli.getArg args (Cli.argument "id") Test.@?= Just "t-abc123"
+ Cli.getArg args (Cli.argument "status") Test.@?= Just "approved",
Test.unit "update with --json flag" <| do
let result = Docopt.parseArgs help ["update", "t-abc123", "done", "--json"]
case result of