Repository navigation
fix(cli): name --override-stale-lock on the top-level adopt help line - #194
Merged
Merged
Conversation
The refusal hint tells the user to pass it and adopt accepts it, but the help line listed only --repo, --rewrite-agent and --dry-run. Refs #95
arcavenai
approved these changes
Oct 8, 2026
arcavenai
left a comment
Member
There was a problem hiding this comment.
Approving. When an adopt conversion refuses on a stale lock, its message tells the user to pass --override-stale-lock. The top-level help now lists that flag on the adopt line too, so a user who checks help can confirm it exists.
Spelling and placement agree.
adopt.go:67parses--override-stale-lockand sets bothopts.OverrideStaleLockandmig.OverrideStaleLock.- In the conversion mode it passes through to enable's guard, whose refusal reads "enable refused (pass --override-stale-lock to proceed past these)" (
internal/enable/enable.go:126). - The flag is on the conversion line, so its placement is right.
adoptUsage(adopt.go:12-14) spells it the same way.sideshow adopt --helpprints the top-level text, so it now shows the same line asmain.go:57.
Red and mutants, all with -count=1.
- The new test fails 3 of 3 runs at 8e2d363, with "adopt line omits --override-stale-lock", and passes 3 of 3 at 07cbbdf.
go test -count=1 ./...passes at head. - Both listed mutants fail the test: the flag misspelled (
--overide-stale-lock) and the flag removed from the line. - So does one I added: the flag moved from the conversion line to the
--finishline.
Nothing else changes. I diffed the output of --help, help, a bare sideshow, and <verb> --help for all 16 verbs between the main and head binaries. Every output differs in that one line and nothing else. The bare sideshow adopt usage error is identical on both. CI on 07cbbdf passes.
Non-blocking, outside item 3:
- The top-level adopt lines still omit flags adopt accepts. The conversion line lacks
<pack>[@<version>],--scope local|projectand--allow-version-change. The--migrate-user-scopeline lacks--commit-consent, and also--override-stale-lock, which that mode honors (internal/adopt/migrate.go:185) and names in its blocker text (migrate.go:186). - The body says the enable and disable lines already show the flag. That is true of their per-verb help, and of the top-level disable line. The top-level enable line (
main.go:49) still omits--override-stale-lock.
Seat: reviewer / reviewer
arcaven
marked this pull request as ready for review
October 8, 2026 12:39
arcaven
added a commit
that referenced
this pull request
Oct 8, 2026
…in the drift (#198) * refactor(cli): name each verb's usage string The enable/disable and activate/deactivate pairs shared one string, so disable advertised --scope and @<version>, and activate omitted --agent. Each verb now has its own, matching its top-level help line and parser. Refs #195 * test: pin the top-level help lines and the parsers to each verb's usage string Refs #195 * fix(cli): bring the top-level adopt and enable help lines in line with their parsers enable gains --override-stale-lock. The adopt conversion line gains <pack>[@<ver>], --scope and --allow-version-change. The migrate line gains --commit-consent and --override-stale-lock. The pin test now joins wrapped help entries, and the stale-lock pin from #194 reads the new conversion line. Closes #195 * refactor(cli): reach each parser through the code its runner runs activate and deactivate decide --agent from the verb, not from an argument a caller supplies. enable, disable, activate and deactivate each have a parser function their runner calls. coexist and project init gain named usage strings. Refs #195 * test: hold the parser pin to the code the runners run, and pin coexist and project init Parse-only verbs must return no error for a flag their usage names. The full-run commands fail when the error names the flag. Review of #198 found two mutants of the activate path that the old check let through. Refs #195 * fix(cli): add --sideshow-active and the project init flags to the top-level help coexist gains --sideshow-active; project init gains --user-name and --dry-run, each named by its own usage string. Refs #195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When adopt refuses on a recent burst log, its hint says to pass
--override-stale-lock, but the top-level help line for adopt does not list that flag, so a user checking help cannot confirm it exists. Adding it to the line makes the help match whatadoptaccepts (cmd/sideshow/adopt.go:13) and what the top-level disable line and the per-verb enable help already show.Item 3 of #95 only. Items 1 and 2 are out of scope: item 1 no longer reproduces, and item 2 (the layer-5 check) waits on a WARN or ERROR ruling. One-line text change; no behavior change.
Existing help tests pin the per-verb help for enable and disable and the top-level fallback, but nothing pinned the top-level adopt line, so this PR adds
TestCLI_TopLevelHelpAdoptLineNamesTheStaleLockOverride. It was red on the parent commit (the line omitted the flag) and passes after the fix.Acceptance:
go test -count=1 ./..., golangci-lint (0 issues), gofumpt -l (empty).-count=1matters for this test: it builds the binary itself, so a cachedgo testrun does not notice a change tomain.go.Refs #95