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

Deprecate -p option (in short form) to dotnet watch #18336

Merged
merged 3 commits into from
Jun 18, 2021

Conversation

pranavkm
Copy link
Contributor

Contributes to dotnet/designs#229

@dotnet-issue-labeler
Copy link

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.

@pranavkm pranavkm requested a review from dsplaisted June 17, 2021 23:44
@@ -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")))
Copy link
Member

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?

Copy link
Contributor Author

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);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what this looks like now sans the SDK error code:

image

Have you decided on what the error code is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NETSDK1174 - #18301

@pranavkm pranavkm enabled auto-merge (squash) June 18, 2021 18:26
@pranavkm pranavkm merged commit 0f1b3a0 into release/6.0.1xx-preview6 Jun 18, 2021
@pranavkm pranavkm deleted the prkrishn/dotnet-watch branch August 31, 2021 19:41
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