diff --git a/src/dotnet/commands/dotnet-add/AddCommandParser.cs b/src/dotnet/commands/dotnet-add/AddCommandParser.cs index d178b80c1..b507a88dc 100644 --- a/src/dotnet/commands/dotnet-add/AddCommandParser.cs +++ b/src/dotnet/commands/dotnet-add/AddCommandParser.cs @@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli .With(name: "VERSION") .ForwardAs(o => $"--version {o.Arguments.Single()}")), Create.Option("-f|--framework", - "Add reference only when targetting a specific framework", + "Add reference only when targeting a specific framework", Accept.ExactlyOneArgument() .With(name: "FRAMEWORK") .ForwardAs(o => $"--framework {o.Arguments.Single()}")), @@ -59,7 +59,7 @@ namespace Microsoft.DotNet.Cli Accept.OneOrMoreArguments(), CommonOptions.HelpOption(), Create.Option("-f|--framework", - "Add reference only when targetting a specific framework", + "Add reference only when targeting a specific framework", Accept.AnyOneOf(Suggest.TargetFrameworksFromProjectFile) .With(name: "FRAMEWORK"))), CommonOptions.HelpOption()); diff --git a/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs b/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs index b452057b8..23b976094 100644 --- a/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs +++ b/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs @@ -2,6 +2,8 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools; +using LocalizableStrings = Microsoft.DotNet.Tools.Remove.ProjectToProjectReference.LocalizableStrings; namespace Microsoft.DotNet.Cli { @@ -11,19 +13,26 @@ namespace Microsoft.DotNet.Cli Create.Command("remove", ".NET Remove Command", Accept.ZeroOrOneArgument() - .With(name: "PROJECT") + .With(name: "PROJECT", + description: CommonLocalizableStrings.ArgumentsProjectDescription) .DefaultToCurrentDirectory(), CommonOptions.HelpOption(), Create.Command("package", - "Command to remove package reference.", + LocalizableStrings.AppFullName, CommonOptions.HelpOption()), - Create.Command("reference", - "Command to remove project to project reference", - Accept.AnyOneOf(Suggest.ProjectReferencesFromProjectFile), - CommonOptions.HelpOption(), - Create.Option("-f|--framework", - "Remove reference only when targetting a specific framework", - Accept.ExactlyOneArgument() - .With(name: "FRAMEWORK")))); + Create.Command( + "reference", + LocalizableStrings.AppFullName, + Accept + .OneOrMoreArguments() + .WithSuggestionsFrom(_ => Suggest.ProjectReferencesFromProjectFile()) + .With(name: "args", + description: LocalizableStrings.AppHelpText), + CommonOptions.HelpOption(), + Create.Option( + "-f|--framework", + "Remove reference only when targeting a specific framework", + Accept.ExactlyOneArgument() + .With(name: "FRAMEWORK")))); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs index 963cd5565..74693b343 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs @@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Tools.Remove.ProjectToProjectReference throw new ArgumentNullException(nameof(appliedCommand)); } - if (_appliedCommand.Arguments.Count == 0) + if (appliedCommand.Arguments.Count == 0) { throw new GracefulException(CommonLocalizableStrings.SpecifyAtLeastOneReferenceToRemove); } diff --git a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs index 793330431..a02968355 100644 --- a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs +++ b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs @@ -15,17 +15,15 @@ namespace Microsoft.DotNet.Cli.Remove.Reference.Tests { private const string HelpText = @".NET Remove Project to Project reference Command -Usage: dotnet remove reference [options] [args] +Usage: dotnet remove reference [options] Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. + The project file to operate on. If a file is not specified, the command will search the current directory for one. + Project to project references to remove Options: - -h|--help Show help information - -f|--framework Remove reference only when targeting a specific framework - -Additional Arguments: - Project to project references to remove + -h, --help Show help information + -f, --framework Remove reference only when targeting a specific framework "; const string FrameworkNet451Arg = "-f net451";