From 9b3151d3eee1dd534f990e5fb0e3151d383fd393 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 13:59:39 -0500 Subject: task: prettier tree visualization and flag ordering fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement box-drawing characters (├──, └──, │) for task tree visualization - Fix 'task create' flag ordering by using [options] in docopt (same as 'task list') - Document TASK_TEST_MODE environment variable in AGENTS.md Testing section - Add test case for multi-flag ordering on 'task create' - Clean up test tasks polluted in production database All 29 tests passing. Amp-Thread-ID: https://ampcode.com/threads/T-4e6225cf-3e78-4538-963c-5377bbbccee8 Co-authored-by: Amp --- Omni/Task.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index eeca4c6..6d2da71 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -38,7 +38,7 @@ task Usage: task init [--quiet] - task create [--type=<type>] [--parent=<id>] [--priority=<p>] [--deps=<ids>] [--dep-type=<type>] [--discovered-from=<id>] [--namespace=<ns>] [--json] + task create <title> [options] task list [options] task ready [--json] task show <id> [--json] @@ -453,5 +453,14 @@ cliTests = let result = Docopt.parseArgs help ["sync"] case result of Left err -> Test.assertFailure <| "Failed to parse 'sync': " <> show err - Right args -> args `Cli.has` Cli.command "sync" Test.@?= True + Right args -> args `Cli.has` Cli.command "sync" Test.@?= True, + Test.unit "create with flags in different order" <| do + let result = Docopt.parseArgs help ["create", "Test", "--json", "--priority=1", "--namespace=Omni/Task"] + case result of + Left err -> Test.assertFailure <| "Failed to parse 'create' with reordered flags: " <> show err + Right args -> do + args `Cli.has` Cli.command "create" Test.@?= True + args `Cli.has` Cli.longOption "json" Test.@?= True + Cli.getArg args (Cli.longOption "priority") Test.@?= Just "1" + Cli.getArg args (Cli.longOption "namespace") Test.@?= Just "Omni/Task" ] -- cgit v1.2.3