Skip to content

Demonstration of "-v" Option Conflict Bug in Spectre.Console Command Settings#1399

Closed
JKamsker wants to merge 1 commit intospectreconsole:mainfrom
JKamsker:bug/version-command-option-override
Closed

Demonstration of "-v" Option Conflict Bug in Spectre.Console Command Settings#1399
JKamsker wants to merge 1 commit intospectreconsole:mainfrom
JKamsker:bug/version-command-option-override

Conversation

@JKamsker
Copy link
Copy Markdown

@JKamsker JKamsker commented Dec 5, 2023

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 the VersionableMammalCommand with 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:

  • VersionableMammalCommand class to simulate a command with a version option.
  • VersionableMammalSettings class to encapsulate the command settings, including the "-v" option.
  • A failing unit test in CommandAppTests.Parsing.cs that 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants