Repository navigation
List each CLI parameter once in the help text - #562
Merged
ChrisonSimtian merged 2 commits intoJul 26, 2026
Merged
ChrisonSimtian merged 2 commits into
ChrisonSimtian merged 2 commits into
Conversation
A build class that implements a component interface and re-declares one of its parameters yields two members for one CLI parameter. The declaration has to be private to reproduce it. GetAllMembers only drops the interface member when the class declares a public member of the same name, and the idiomatic build-class parameter is a private readonly field. 3 of 5 fail: --api-key is listed twice, and there is no rule for which declaration wins. Part of Fallout-build#554 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Group parameter members by the name the user types and keep the most specific declaration. Interface declarations rank below any class declaration; among classes, the deeper the inheritance chain, the more specific. A build class that implements a component interface and re-declares one of its parameters produced two members for one CLI parameter. --help printed it twice, and the generated schema wrote both under one key, so which declaration's description and type survived was incidental. This resolves the standing "check duplicated names" note on GetParameterMembers. Closes Fallout-build#554 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChrisonSimtian
marked this pull request as ready for review
July 26, 2026 12:33
dennisdoomen
approved these changes
Jul 26, 2026
This was referenced Nov 7, 2026
This was referenced Nov 10, 2026
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.
Collapses duplicate declarations of one CLI parameter. On this repo,
./build.sh --helpprinted--nuget-api-keytwice.What changed
ValueInjectionUtility.GetParameterMembersgroups members by the dashed name the user types, and keeps the most specific declaration.DuplicateParameterSpecs.Why
A build class can implement a component interface and re-declare one of its parameters.
build/Build.csdoes this withNuGetApiKey, whichIPublishalso declares. Both members reached the help renderer.Two notes for review:
GetAllMembersdrops the interface member when the class declares a public member of the same name, and the idiomatic build-class parameter is a private readonly field. The specs declare their fields private for this reason.This resolves the standing
// TODO: check duplicated namesonGetParameterMembers.Verification
dotnet test tests/Fallout.Build.Specs— 5 new specs pass, 3 of which failed before the fix../build.sh --helpnow lists--nuget-api-keyonce.Closes #554