Skip to content

refactor: Target Flag Shorthands + Targets-First Root Help#29

Merged
sahil-noon merged 5 commits into
mainfrom
260705-ncbf-target-flag-shorthands-help
Jul 5, 2026
Merged

refactor: Target Flag Shorthands + Targets-First Root Help#29
sahil-noon merged 5 commits into
mainfrom
260705-ncbf-target-flag-shorthands-help

Conversation

@sahil-noon

Copy link
Copy Markdown
Collaborator

Meta

Change ID Type Confidence Plan Review
ncbf refactor 4.4/5.0 5/5 tasks, 12/12 acceptance ✓ ✓ 2 cycles
Impact +/− Net
raw +513 / −32 +481
true +155 / −10 +145
└ impl +18 / −10 +8
└ tests +137 / −0 +137

excludes fab/, docs/ · generated by fab-kit v2.13.4

Pipeline: 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/-s shorthands for --main/--system and restructures the root help around a leading Targets section.

Changes

  • Shorthand registration on root persistent flags (src/cmd/idea/main.go)
  • Targets-first root Long help text (src/cmd/idea/main.go)
  • README touch-up mentioning the new short forms
  • Tests

sahil87 added 2 commits July 6, 2026 00:44
BoolVarP for --main/--system persistent flags, restructured root Long
around a Targets block, and README touch-ups mentioning the new short
forms.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/-s shorthands for --file/--main/--system on root persistent flags.
  • Restructure root Long help text to be targets-first and clarify --main/--system exclusivity and --file behavior 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.

Comment thread src/cmd/idea/main_test.go Outdated
Comment on lines +1118 to +1121
// 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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread src/cmd/idea/main_test.go
Comment on lines +1184 to +1189
args := []string{flagForm}
if argFile != "" {
args = append(args, argFile)
}
args = append(args, "add", "--id", "ab12", "shared idea")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@sahil-noon sahil-noon marked this pull request as ready for review July 5, 2026 23:07
@sahil-noon sahil-noon merged commit 1613a0f into main Jul 5, 2026
2 checks passed
@sahil-noon sahil-noon deleted the 260705-ncbf-target-flag-shorthands-help branch July 5, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants