From dbd1e0ff1f6c3f813c90cba060dccfa4035f2947 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Thu, 19 Nov 2026 23:34:48 -0700 Subject: [PATCH 1/2] Document that list accepts --sort none as creation order The README said every value outside the supported sort keys is rejected, but `list --sort none` (any capitalization) is accepted and keeps creation order, because `none` is the option's default value. Document it and pin the behaviour with a test. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- .../parpt/command/ListProjectsCommandTest.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c10dbf..a178577 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ list --sort name list -s impact ``` -Supported `--sort` values are `name`, `impact`, `confidence`, `ease`, `reach`, `effort`, `ice` and `rice`. Every value except `name` sorts from highest to lowest; omitting `--sort` keeps the order in which projects were created. Values are not case-sensitive, so `--sort ICE` works too. Any other value prints `Invalid sort option. Use one of: name, impact, confidence, ease, reach, effort, ice, rice (or omit --sort to keep creation order).` and lists nothing. The sort value is checked only when projects are saved: with none, `list` prints `No projects found.` whatever `--sort` was given. +Supported `--sort` values are `name`, `impact`, `confidence`, `ease`, `reach`, `effort`, `ice` and `rice`. Every value except `name` sorts from highest to lowest; omitting `--sort` keeps the order in which projects were created. Values are not case-sensitive, so `--sort ICE` works too. `--sort none` is also accepted, in any capitalization, and does the same as omitting `--sort`: creation order under a plain `Projects:` header. Any other value prints `Invalid sort option. Use one of: name, impact, confidence, ease, reach, effort, ice, rice (or omit --sort to keep creation order).` and lists nothing. The sort value is checked only when projects are saved: with none, `list` prints `No projects found.` whatever `--sort` was given. With only the project made by the create examples' option-only command saved, `list --sort ice` prints: ```text diff --git a/src/test/java/com/preponderous/parpt/command/ListProjectsCommandTest.java b/src/test/java/com/preponderous/parpt/command/ListProjectsCommandTest.java index 12a0883..024b693 100644 --- a/src/test/java/com/preponderous/parpt/command/ListProjectsCommandTest.java +++ b/src/test/java/com/preponderous/parpt/command/ListProjectsCommandTest.java @@ -95,6 +95,21 @@ void shouldPreserveCreationOrderWhenNoSortOptionIsGiven() throws ProjectReposito assertTrue(result.indexOf("Zebra") < result.indexOf("Apple")); } + @Test + void shouldKeepCreationOrderWhenNoneIsTypedAsTheSortValue() throws ProjectRepository.NameTakenException { + // Given projects are created out of alphabetical and score order + projectService.createProject("Zebra", "Created first", 1, 1, 1, 1, 1); + projectService.createProject("Apple", "Created second", 5, 5, 5, 5, 1); + + // When the user types --sort none, in a capitalization other than the default's + var result = listProjectsCommand.execute("NONE"); + + // Then it is accepted like an omitted --sort: creation order under the unqualified header + assertFalse(result.contains("Invalid sort option")); + assertTrue(result.startsWith("Projects:\n")); + assertTrue(result.indexOf("Zebra") < result.indexOf("Apple")); + } + @Test void shouldSortByNameWhenNameSortIsRequested() throws ProjectRepository.NameTakenException { // Given projects are created out of alphabetical order From 0e369d1a31350320ea2b8151877ba87d36ffff74 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Thu, 19 Nov 2026 23:37:27 -0700 Subject: [PATCH 2/2] Disambiguate "with none" now that --sort none is documented Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a178577..bacdd44 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ list --sort name list -s impact ``` -Supported `--sort` values are `name`, `impact`, `confidence`, `ease`, `reach`, `effort`, `ice` and `rice`. Every value except `name` sorts from highest to lowest; omitting `--sort` keeps the order in which projects were created. Values are not case-sensitive, so `--sort ICE` works too. `--sort none` is also accepted, in any capitalization, and does the same as omitting `--sort`: creation order under a plain `Projects:` header. Any other value prints `Invalid sort option. Use one of: name, impact, confidence, ease, reach, effort, ice, rice (or omit --sort to keep creation order).` and lists nothing. The sort value is checked only when projects are saved: with none, `list` prints `No projects found.` whatever `--sort` was given. +Supported `--sort` values are `name`, `impact`, `confidence`, `ease`, `reach`, `effort`, `ice` and `rice`. Every value except `name` sorts from highest to lowest; omitting `--sort` keeps the order in which projects were created. Values are not case-sensitive, so `--sort ICE` works too. `--sort none` is also accepted, in any capitalization, and does the same as omitting `--sort`: creation order under a plain `Projects:` header. Any other value prints `Invalid sort option. Use one of: name, impact, confidence, ease, reach, effort, ice, rice (or omit --sort to keep creation order).` and lists nothing. The sort value is checked only when projects are saved: with no projects saved, `list` prints `No projects found.` whatever `--sort` was given. With only the project made by the create examples' option-only command saved, `list --sort ice` prints: ```text