Demonstration of "-v" Option Conflict Bug in Spectre.Console Command Settings#1399
Closed
JKamsker wants to merge 1 commit intospectreconsole:mainfrom
Closed
Demonstration of "-v" Option Conflict Bug in Spectre.Console Command Settings#1399JKamsker wants to merge 1 commit intospectreconsole:mainfrom
JKamsker wants to merge 1 commit intospectreconsole:mainfrom
Conversation
6 tasks
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.
This pull request introduces a test case that demonstrates an existing bug in Spectre.Console where the command option "-v" is incorrectly prioritized as a version flag rather than as an argument to a command when both are present.
Test Case
A new test case,
Should_Allow_VersionableMammalCommand, has been added to clearly illustrate the problem. This test is designed to run theVersionableMammalCommandwith the "-v" option followed by a version number. The expected output is "Versionable ran!", which confirms the command's execution. The current failing state of this test highlights the bug in question.Changes
This pull request includes the following additions:
VersionableMammalCommandclass to simulate a command with a version option.VersionableMammalSettingsclass to encapsulate the command settings, including the "-v" option.CommandAppTests.Parsing.csthat exposes the incorrect behavior.Objective
The sole purpose of this pull request is to provide a clear and concise demonstration of the bug through a failing test case. It serves as a basis for discussion and further development towards a fix.
Next Steps
The next step would be to address the bug identified by this test case in a separate pull request. This would involve modifying the command parsing logic to correctly handle the "-v" option within command settings.