← Back to task

Commit 4f4b03a2

commit 4f4b03a2f4983d64a82f036a6a2fad281837e975
Author: Ben Sima <ben@bensima.com>
Date:   Mon Dec 1 15:45:47 2025

    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

diff --git a/Omni/Task.hs b/Omni/Task.hs
index 1385a4b2..0d8d6c89 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}")