Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-v flag conflict between additional commands and default command #1479

Open
BCoskun opened this issue Feb 29, 2024 · 2 comments
Open

-v flag conflict between additional commands and default command #1479

BCoskun opened this issue Feb 29, 2024 · 2 comments
Assignees
Labels
area-CLI Command-Line Interface bug Something isn't working ⭐ top bug Top bug.

Comments

@BCoskun
Copy link

BCoskun commented Feb 29, 2024

Information

  • V0.47 and 0.48 behavior change for -v flag.

Describe the bug
I was using -v short hand flag for sub command and it was working until V0.48 . With Version 0.48 parsing behavior changed and when we use -v for subcommand, it print application version directly.

To Reproduce
With Version 0.47 ConsoleApp.exe -v and ConsoleApp.exe subcommand -v has different behavior.
With Version 0.48 ConsoleApp.exe -v and ConsoleApp.exe subcommand -v has same behavior.

Expected behavior
The sub command -v should be parsed for the sub command context


Please upvote 👍 this issue if you are interested in it.

@BCoskun BCoskun added bug Something isn't working needs triage labels Feb 29, 2024
@JKamsker
Copy link

Can you provide an unit test for this?
This would help understanding the problem and having a definition of "done"

Similar bug in the past #1400
My issue probably caused this change 😅

I guess there is no absolute right answer, and if it is it is harder to do than it may first look like

@FrankRay78
Copy link
Contributor

I introduced the bug @JKamsker, unfortunately. I knew it was a breaking change, and flagged it as such, but I think the change in functionality is probably now best described as a regression. I'll add this to my stack to review/address.

#1400 (comment)

And

FYI. I've submitted the PR above to revert this to existing behaviour @JKamsker

#1400 (comment)

Background
Apologies for creating this problem. The above issue description is exactly correct, we changed this behaviour between 0.47 and 0.48.

It had worked as per the current 0.48 earlier than 0.47, then I did some refactoring, changed it to the behaviour in 0.47, flagged it as a breaking change (thinking it was fine to make breaking changes, if warranted, as we are still < version 1.0), which was accepted by the maintainer team and merged.

Then we found a number of unhappy users of spectre.console (because we broke their apps), and so on further consideration, we reverted the change. Unfortunately, I doubt we'd be looking to revert it once again.

@FrankRay78 FrankRay78 added area-CLI Command-Line Interface and removed needs triage labels Mar 7, 2024
@FrankRay78 FrankRay78 self-assigned this Mar 7, 2024
@github-actions github-actions bot added the ⭐ top bug Top bug. label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CLI Command-Line Interface bug Something isn't working ⭐ top bug Top bug.
Projects
Status: Todo 🕑
Development

No branches or pull requests

3 participants