diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-20 11:37:45 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-20 11:37:45 -0500 |
| commit | 054e3f2c1611250664105f5b6b6db97adb41643b (patch) | |
| tree | 81ee9e7fd32d69087bea9388922290becaa6f07f /Omni/Task/Core.hs | |
| parent | d49ad52d35a9c5141265d4fb91421a09033c57f9 (diff) | |
Add task show command for detailed task inspection
- Implemented 'task show <id>' command with human-readable output -
Shows all task fields: title, type, status, priority, timestamps -
Displays dependencies with their types - Supports --json flag for
programmatic use - Added CLI tests for show command - Includes priority
descriptions (Critical/High/Medium/Low/Backlog)
Diffstat (limited to 'Omni/Task/Core.hs')
| -rw-r--r-- | Omni/Task/Core.hs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 6c472c5..1dc31a8 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -373,6 +373,43 @@ printTask t = Nothing -> "" Just ns -> " [" <> ns <> "]" +-- Show detailed task information (human-readable) +showTaskDetailed :: Task -> IO () +showTaskDetailed t = do + putText "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + putText <| "Task: " <> taskId t + putText "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + putText <| "Title: " <> taskTitle t + putText <| "Type: " <> T.pack (show (taskType t)) + putText <| "Status: " <> T.pack (show (taskStatus t)) + putText <| "Priority: " <> T.pack (show (taskPriority t)) <> priorityDesc + case taskParent t of + Nothing -> pure () + Just p -> putText <| "Parent: " <> p + case taskNamespace t of + Nothing -> pure () + Just ns -> putText <| "Namespace: " <> ns + putText <| "Created: " <> T.pack (show (taskCreatedAt t)) + putText <| "Updated: " <> T.pack (show (taskUpdatedAt t)) + + -- Show dependencies + unless (null (taskDependencies t)) <| do + putText "" + putText "Dependencies:" + traverse_ printDependency (taskDependencies t) + + putText "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + where + priorityDesc = case taskPriority t of + P0 -> " (Critical)" + P1 -> " (High)" + P2 -> " (Medium)" + P3 -> " (Low)" + P4 -> " (Backlog)" + + printDependency dep = + putText <| " - " <> depId dep <> " [" <> T.pack (show (depType dep)) <> "]" + -- Export tasks: Consolidate JSONL file (remove duplicates, keep latest version) exportTasks :: IO () exportTasks = do |
