diff options
Diffstat (limited to 'Omni/Task.hs')
| -rw-r--r-- | Omni/Task.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs index be54d3d..808e73f 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -32,7 +32,7 @@ task Usage: task init - task create <title> <project> [--deps=<ids>] + task create <title> <project> [--deps=<ids>] [--namespace=<ns>] task list [--project=<project>] task ready task update <id> <status> @@ -57,6 +57,7 @@ Options: -h --help Show this help --project=<project> Filter by project --deps=<ids> Comma-separated list of dependency IDs + --namespace=<ns> Optional namespace (e.g., Omni/Task, Biz/Cloud) --flush Force immediate export -i <file> Input file for import @@ -77,7 +78,10 @@ move args deps <- case Cli.getArg args (Cli.longOption "deps") of Nothing -> pure [] Just depStr -> pure <| T.splitOn "," (T.pack depStr) - task <- createTask title project deps + namespace <- case Cli.getArg args (Cli.longOption "namespace") of + Nothing -> pure Nothing + Just ns -> pure <| Just (T.pack ns) + task <- createTask title project namespace deps putStrLn <| "Created task: " <> T.unpack (taskId task) | args `Cli.has` Cli.command "list" = do maybeProject <- case Cli.getArg args (Cli.longOption "project") of @@ -131,7 +135,7 @@ unitTests = when exists <| removeFile ".tasks/tasks.jsonl" initTaskDb - task <- createTask "Test task" "test-project" [] + task <- createTask "Test task" "test-project" Nothing [] taskTitle task Test.@?= "Test task" taskProject task Test.@?= "test-project" taskStatus task Test.@?= Open @@ -140,8 +144,8 @@ unitTests = tasks <- listTasks Nothing not (null tasks) Test.@?= True, Test.unit "ready tasks exclude blocked ones" <| do - task1 <- createTask "First task" "test" [] - task2 <- createTask "Blocked task" "test" [taskId task1] + task1 <- createTask "First task" "test" Nothing [] + task2 <- createTask "Blocked task" "test" Nothing [taskId task1] ready <- getReadyTasks (taskId task1 `elem` map taskId ready) Test.@?= True (taskId task2 `notElem` map taskId ready) Test.@?= True |
