commit a4d7cffe84aa43c5e9dea37d4e5c1e8c741d4cea
Author: Coder Agent <coder@agents.omni>
Date: Wed Feb 11 21:58:14 2026
Omni/Task: allow clearing namespace in task edit command
- treat empty `--namespace` value as an explicit clear operation
- preserve existing namespace behavior for non-empty values
- update edit CLI help text to document empty-string clear semantics
Task-Id: t-590
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 7bef51f4..f2af91c3 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -202,7 +202,7 @@ editParser =
<*> Cli.optional (Cli.strOption (Cli.long "parent" <> Cli.metavar "ID" <> Cli.help "Parent epic ID"))
<*> Cli.optional (Cli.strOption (Cli.long "priority" <> Cli.metavar "P" <> Cli.help "Priority: 0-4"))
<*> Cli.optional (Cli.option Cli.auto (Cli.long "complexity" <> Cli.metavar "C" <> Cli.help "Complexity: 1-5"))
- <*> Cli.optional (Cli.strOption (Cli.long "namespace" <> Cli.metavar "NS" <> Cli.help "Namespace"))
+ <*> Cli.optional (Cli.strOption (Cli.long "namespace" <> Cli.metavar "NS" <> Cli.help "Namespace (empty string clears)"))
<*> Cli.optional (Cli.strOption (Cli.long "status" <> Cli.metavar "STATUS" <> Cli.help "Status"))
<*> Cli.optional (Cli.strOption (Cli.long "description" <> Cli.metavar "DESC" <> Cli.help "Description"))
<*> Cli.optional (Cli.strOption (Cli.long "deps" <> Cli.metavar "IDS" <> Cli.help "Dependency IDs"))
@@ -265,10 +265,14 @@ doEdit GlobalOpts {..} tidStr maybeTitle maybeType maybeParent maybePriority may
namespaceM <- case maybeNamespace of
Nothing -> pure Nothing
- Just ns -> do
- let validNs = Namespace.fromHaskellModule ns
- nsPath = T.pack <| Namespace.toPath validNs
- pure <| Just nsPath
+ Just nsRaw -> do
+ let ns = T.pack nsRaw
+ if T.null (T.strip ns)
+ then pure <| Just Nothing
+ else do
+ let validNs = Namespace.fromHaskellModule nsRaw
+ nsPath = T.pack <| Namespace.toPath validNs
+ pure <| Just (Just nsPath)
depsM <- case maybeDiscoveredFrom of
Just discoveredId -> pure <| Just [Dependency {depId = T.pack discoveredId, depType = DiscoveredFrom}]
@@ -294,7 +298,7 @@ doEdit GlobalOpts {..} tidStr maybeTitle maybeType maybeParent maybePriority may
{ taskTitle = maybe (taskTitle task) T.pack maybeTitle,
taskType = fromMaybe (taskType task) taskTypeM,
taskParent = case maybeParent of Nothing -> taskParent task; Just p -> Just (T.pack p),
- taskNamespace = case namespaceM of Nothing -> taskNamespace task; Just ns -> Just ns,
+ taskNamespace = fromMaybe (taskNamespace task) namespaceM,
taskStatus = fromMaybe (taskStatus task) statusM,
taskPriority = fromMaybe (taskPriority task) priorityM,
taskComplexity = fromMaybe (taskComplexity task) complexityM,