summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs19
1 files changed, 16 insertions, 3 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs
index f10ae25..ae854a7 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -35,7 +35,7 @@ task
Usage:
task init
task create <title> [--type=<type>] [--parent=<id>] [--deps=<ids>] [--dep-type=<type>] [--discovered-from=<id>] [--namespace=<ns>]
- task list [--type=<type>] [--parent=<id>]
+ task list [--type=<type>] [--parent=<id>] [--status=<status>] [--namespace=<ns>]
task ready
task update <id> <status>
task deps <id>
@@ -59,6 +59,7 @@ Options:
-h --help Show this help
--type=<type> Task type: epic or task (default: task)
--parent=<id> Parent epic ID
+ --status=<status> Filter by status: open, in-progress, done
--deps=<ids> Comma-separated list of dependency IDs
--dep-type=<type> Dependency type: blocks, discovered-from, parent-child, related (default: blocks)
--discovered-from=<id> Shortcut for --deps=<id> --dep-type=discovered-from
@@ -124,7 +125,19 @@ move args
maybeParent <- case Cli.getArg args (Cli.longOption "parent") of
Nothing -> pure Nothing
Just p -> pure <| Just (T.pack p)
- tasks <- listTasks maybeType maybeParent
+ maybeStatus <- case Cli.getArg args (Cli.longOption "status") of
+ Nothing -> pure Nothing
+ Just "open" -> pure <| Just Open
+ Just "in-progress" -> pure <| Just InProgress
+ Just "done" -> pure <| Just Done
+ Just other -> panic <| "Invalid status: " <> T.pack other <> ". Use: open, in-progress, or done"
+ maybeNamespace <- case Cli.getArg args (Cli.longOption "namespace") of
+ Nothing -> pure Nothing
+ Just ns -> do
+ let validNs = Namespace.fromHaskellModule ns
+ nsPath = T.pack <| Namespace.toPath validNs
+ pure <| Just nsPath
+ tasks <- listTasks maybeType maybeParent maybeStatus maybeNamespace
traverse_ printTask tasks
| args `Cli.has` Cli.command "ready" = do
tasks <- getReadyTasks
@@ -184,7 +197,7 @@ unitTests =
null (taskDependencies task) Test.@?= True,
Test.unit "can list tasks" <| do
_ <- createTask "Test task for list" WorkTask Nothing Nothing []
- tasks <- listTasks Nothing Nothing
+ tasks <- listTasks Nothing Nothing Nothing Nothing
not (null tasks) Test.@?= True,
Test.unit "ready tasks exclude blocked ones" <| do
task1 <- createTask "First task" WorkTask Nothing Nothing []