-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Deprecate -p option (in short form) to dotnet watch #18336
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
@@ -147,6 +147,11 @@ internal static RootCommand CreateRootCommand(Func<CommandLineOptions, Task<int> | |||
root.TreatUnmatchedTokensAsErrors = false; | |||
root.Handler = CommandHandler.Create((CommandLineOptions options, ParseResult parseResults) => | |||
{ | |||
if (!string.IsNullOrEmpty(parseResults.ValueForOption<string>("-p"))) |
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.
I don't know how the command line parsing works here. Have you validated that if --project
is used, the warning isn't printed (since they are both the same Option
)? Should we have an automated test for that?
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.
You're right. It prints a warning in either case.
@@ -147,6 +147,11 @@ internal static RootCommand CreateRootCommand(Func<CommandLineOptions, Task<int> | |||
root.TreatUnmatchedTokensAsErrors = false; | |||
root.Handler = CommandHandler.Create((CommandLineOptions options, ParseResult parseResults) => | |||
{ | |||
if (!string.IsNullOrEmpty(parseResults.ValueForOption<string>("-p"))) | |||
{ | |||
reporter.Warn(Resources.Warning_ProjectAbbreviationDeprecated); |
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.
What does this actually look like in the console output? It looks like we're going to go with the following (in yellow text) for dotnet run
:
Warning NETSDKNNNN: The abbreviation of -p for --project is deprecated. Please use --project.
Where NNNN is replaced with an SDK error code, so you can better search for information about the error.
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.
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.
NETSDK1174 - #18301
Contributes to dotnet/designs#229