fix: bind inherited branch options for derived command settings#66
Open
bryansray wants to merge 1 commit intospectreconsole:mainfrom
Open
fix: bind inherited branch options for derived command settings#66bryansray wants to merge 1 commit intospectreconsole:mainfrom
bryansray wants to merge 1 commit intospectreconsole:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
Code ReviewPR: #66 - fix: bind inherited branch options for derived command settings Changes
Review✅ Correctness: The fix properly traverses the command tree parent chain to find inherited options No issues found. Good to merge. |
patriksvensson
approved these changes
Mar 13, 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.
Fixes #29
AI Disclosure
I used OpenAI Codex (GPT-5 based coding agent) to help implement this PR.
AI assistance was used to:
I reviewed the changes and validated the final solution by running the full test suite.
Changes
This PR fixes inherited command options not being recognized for derived command settings under branches (issue #29), especially when the option is provided after the leaf command token.
Implementation
src/Spectre.Console.Cli/Internal/Parsing/CommandTreeExtensions.csTests
src/Spectre.Console.Cli.Tests/Data/Settings/BranchInheritanceSettings.cssrc/Spectre.Console.Cli.Tests/CommandAppTests.Branches.cs--my-value).ValidateExamples()behavior for the same inherited option scenario.Verification
476/476onnet8.0,net9.0,net10.0)