Fix CLI option registry drift (#4861) - #4959
Draft
Widthdom wants to merge 6 commits into
Draft
Conversation
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.
Summary
CliFlagSchemathe authoritative source for command-specific accepted values, aliases, safety/scope metadata, nested completion contexts, help, validation, and parser option partitions--dry-run, hook install/uninstall--force, and path-aware hook project completiongoto --exact, preserve exact output-format normalization, and document the registry contract in the bilingual developer, testing, and user guideschangelog.d/unreleased/4861.fixed.mdRoot cause
Accepted option names and values were duplicated across parsers, help text, validation, and four completion renderers. Those parallel lists drifted, so valid values were omitted while rejected options or aliases were advertised. Nested hook verbs also lacked enough shared context to scope safety-sensitive flags accurately.
The initial pipeline failure was test-only:
ConsoleUiTests.PrintCommandUsage_DedicatedParsersOnlyEmitAuthoritativeParentOptionLists_Issues4571_4861asserted LF delimiters directly, while Windows captured CRLF output. The test now normalizes line endings before checking section boundaries.Validation
dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false— passed, 0 warnings/errorsdotnet build CodeIndex.sln -c Debug -p:UseSharedCompilation=false— passed, 0 warnings/errorsorigin/main: net8.0 297 passed; net9.0 297 passedConsoleUiTestscase passed on net8.0 after line-ending normalizationdotnet format CodeIndex.sln --verify-no-changes --no-restore— passedindex_matches_workspace: trueatf6b21a176A full Release test run was also attempted before the CI follow-up: net9 was green; net8 retained the known subproject watcher failure tracked by #4955. A separate transient Unicode worker failure passed when rerun in isolation.
Fixes #4861