summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-01 15:45:47 -0500
committerBen Sima <ben@bensima.com>2025-12-01 15:45:47 -0500
commit4f4b03a2f4983d64a82f036a6a2fad281837e975 (patch)
tree998fd7628973c87e6b14526601014a2e11857f46 /Omni/Task.hs
parent2151b67836d209645b85bb64d56a96bfbf2859cd (diff)
Add --complexity flag to task update command
Allows updating complexity along with status in a single command: jr task update t-123 in-progress --complexity=3 Task-Id: t-222
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 1385a4b..0d8d6c8 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -339,6 +339,13 @@ move' args
statusStr <- getArgText args "status"
let isVerified = args `Cli.has` Cli.longOption "verified"
+ -- Handle complexity update
+ maybeComplexity <- case Cli.getArg args (Cli.longOption "complexity") of
+ Nothing -> pure Nothing
+ Just c -> case readMaybe c of
+ Just n | n >= 1 && n <= 5 -> pure (Just n)
+ _ -> panic <| "Invalid complexity: " <> T.pack c <> ". Use: 1-5"
+
-- Handle update dependencies
deps <- do
-- Parse --deps and --dep-type
@@ -375,6 +382,11 @@ move' args
updateTaskStatusWithActor tid newStatus deps Human
+ -- Update complexity if provided
+ case maybeComplexity of
+ Nothing -> pure ()
+ Just c -> void <| editTask tid (\t -> t {taskComplexity = Just c})
+
-- Record verification in activity log if verified
when (newStatus == Done && isVerified)
<| logActivity tid Completed (Just "{\"verified\":true}")