refactor: Target Flag Shorthands + Targets-First Root Help#29
Conversation
BoolVarP for --main/--system persistent flags, restructured root Long around a Targets block, and README touch-ups mentioning the new short forms.
There was a problem hiding this comment.
Pull request overview
Refactors the idea CLI’s root command UX by adding single-letter shorthands for the three persistent target flags and reorganizing root help text to lead with a clear “Targets” section, with matching doc updates and end-to-end tests to validate equivalence and conflict behavior.
Changes:
- Add
-f/-m/-sshorthands for--file/--main/--systemon root persistent flags. - Restructure root
Longhelp text to be targets-first and clarify--main/--systemexclusivity and--filebehavior under--system. - Add CLI subprocess tests for shorthand equivalence and mixed-form mutual-exclusion; update README + site docs + memory docs accordingly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cmd/idea/main.go | Adds StringVarP/BoolVarP shorthands and rewrites root Long help with a Targets-first section. |
| src/cmd/idea/main_test.go | Adds end-to-end subprocess tests covering shorthand equivalence and mixed long/short conflict cases. |
| README.md | Documents -m/-s/-f additively alongside existing long-form flag mentions and corrects XDG claim on touched line. |
| docs/site/workflows.md | Mirrors README targeting docs with additive shorthand mentions and corrects XDG claim on touched lines. |
| docs/memory/cli/structure.md | Updates CLI “memory” documentation to include shorthands and Targets-first root help details. |
| docs/memory/cli/index.md | Updates memory index description line to reflect the updated structure.md description. |
| fab/changes/260705-ncbf-target-flag-shorthands-help/plan.md | Adds the generated plan/requirements/acceptance details for the change. |
| fab/changes/260705-ncbf-target-flag-shorthands-help/intake.md | Adds the generated intake describing motivations, scope, and assumptions. |
| fab/changes/260705-ncbf-target-flag-shorthands-help/.status.yaml | Records fab pipeline status/progress metadata for the change. |
| fab/changes/260705-ncbf-target-flag-shorthands-help/.history.jsonl | Records fab pipeline history events for the change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // short and long forms run against independent, isolated setups (fresh repo / | ||
| // fresh HOME) with a fixed --id so output and the resulting backlog are | ||
| // deterministic, then both the stdout confirmation and the targeted backlog | ||
| // file are asserted byte-identical. Table-driven, real temp dirs / real git |
There was a problem hiding this comment.
Fixed — the two add invocations now pass a fixed --date 2026-01-01 alongside --id ab12, so stdout and the backlog line are fully deterministic and the byte-identical comparisons can't straddle a date boundary. Updated the function doc comment to match. (56c83cb)
| args := []string{flagForm} | ||
| if argFile != "" { | ||
| args = append(args, argFile) | ||
| } | ||
| args = append(args, "add", "--id", "ab12", "shared idea") | ||
|
|
There was a problem hiding this comment.
Fixed — the add args now include a fixed --date 2026-01-01 next to --id ab12, so the backlog line and stdout no longer depend on time.Now() and the cross-invocation byte comparison is robust around midnight. (56c83cb)
Meta
ncbfexcludes
fab/,docs/· generated by fab-kit v2.13.4Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
The three backlog-targeting modes (current worktree,
--main,--system) are the CLI's core mental model but were barely surfaced in root help, and the most-typed flags had no short forms. This adds-m/-sshorthands for--main/--systemand restructures the root help around a leading Targets section.Changes
src/cmd/idea/main.go)Longhelp text (src/cmd/idea/main.go)