-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
GH4278: Update Spectre.Console to 0.48.0 #4279
base: develop
Are you sure you want to change the base?
Conversation
devlead
commented
Nov 24, 2023
- fixes Update Spectre.Console to 0.48.0 #4278
It would seem Spectre.Console 0.48.0 has a breaking change with settings like cake/src/Cake/Commands/DefaultCommandSettings.cs Lines 55 to 57 in ed61202
This test fails cake/src/Cake.Tests/Unit/ProgramTests.cs Lines 101 to 104 in ed61202
only the last not investigated the root cause fully. |
Found the issue Spectre.Console.Cli no longer allows default commands to have a Will see if I can find away around that, can't use the default Spectre version command as it will produce a version string that will break Cake cli contract. Overriding command settings |
As it's by design breaking change in Spectre.Console.Cli, I just added a workaround to opt-out of this behavior for Cake.Tool. |
"-v" => "--ver", | ||
"--version" => "--ver", | ||
_ => arg | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a terrible workaround, should've probably just addressed if first arg is -v
/ --version
... but the problem goes deeper.
Spectre.Console.Cli switched from
- if (firstArgument.Equals("--version", StringComparison.OrdinalIgnoreCase) ||
- firstArgument.Equals("-v", StringComparison.OrdinalIgnoreCase))
to
+ if (args.Contains("-v") || args.Contains("--version"))
+ {
so the default command behavior changed from first to any supplied argument is --version
/ -v
will print the version and exit the application. even i.e. --
between command and remaining args used.
so will have to think about this a bit more. moving PR to WIP.