diff --git a/src/dotnet/CommonLocalizableStrings.cs b/src/dotnet/CommonLocalizableStrings.cs index 0a296bffc..666ed56f4 100644 --- a/src/dotnet/CommonLocalizableStrings.cs +++ b/src/dotnet/CommonLocalizableStrings.cs @@ -101,13 +101,13 @@ namespace Microsoft.DotNet.Tools public const string MoreThanOneProjectInDirectory = "Found more than one project in `{0}`. Please specify which one to use."; public const string FoundInvalidProject = "Found a project `{0}` but it is invalid."; public const string InvalidProject = "Invalid project `{0}`."; - public const string InvalidProjectWithExceptionMessage = "Invalid project `{0}`. {1}"; + public const string InvalidProjectWithExceptionMessage = "Invalid project `{0}`. {1}."; /// Solution public const string CouldNotFindSolutionIn = "Specified solution file {0} does not exist, or there is no solution file in the directory."; public const string CouldNotFindSolutionOrDirectory = "Could not find solution or directory `{0}`."; public const string MoreThanOneSolutionInDirectory = "Found more than one solution file in {0}. Please specify which one to use."; - public const string InvalidSolutionFormatString = "Invalid solution `{0}`. {1}"; // {0} is the solution path, {1} is already localized details on the failure + public const string InvalidSolutionFormatString = "Invalid solution `{0}`. {1}."; // {0} is the solution path, {1} is already localized details on the failure public const string SolutionDoesNotExist = "Specified solution file {0} does not exist, or there is no solution file in the directory."; /// add p2p @@ -185,13 +185,15 @@ namespace Microsoft.DotNet.Tools public const string ProjectNotCompatibleWithFrameworks = "Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Please review the project you are trying to add and verify that is compatible with the following targets:"; public const string ProjectDoesNotTargetFramework = "Project `{0}` does not target framework `{1}`."; - public const string ProjectCouldNotBeEvaluated = "Project `{0}` could not be evaluated. Evaluation failed with following error:\n{1}"; + public const string ProjectCouldNotBeEvaluated = "Project `{0}` could not be evaluated. Evaluation failed with following error:\n{1}."; /// common options - public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"; + public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."; public const string FrameworkOptionDescription = "Target framework to publish for. The target framework has to be specified in the project file."; public const string RuntimeOptionDescription = "Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app."; public const string ConfigurationOptionDescription = "Configuration to use for building the project. Default for most projects is \"Debug\"."; public const string CmdVersionSuffixDescription = "Defines the value for the $(VersionSuffix) property in the project."; + + public const string ShowHelpDescription = "Show help information."; } } diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index e2ea884ef..06047fcd3 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli public static Option HelpOption() => Create.Option( "-h|--help", - "Show help information", + CommonLocalizableStrings.ShowHelpDescription, Accept.NoArguments(), materialize: o => o.Option.Command().HelpView()); diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs b/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs index bf364d895..e502c8fc8 100644 --- a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs @@ -35,6 +35,6 @@ namespace Microsoft.DotNet.Tools.Restore public const string CmdIgnoreFailedSourcesOptionDescription = "Treat package source failures as warnings."; - public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project"; + public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project."; } } diff --git a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs index 7561ddb2d..ed1011d3b 100644 --- a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs +++ b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs @@ -23,7 +23,7 @@ Arguments: Project to project references to add Options: - -h, --help Show help information + -h, --help Show help information. -f, --framework Add reference only when targeting a specific framework "; @@ -35,7 +35,7 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: package .NET Add Package reference Command diff --git a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs index 20c2282e5..9f3bd680b 100644 --- a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs +++ b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs @@ -21,7 +21,7 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. "; private const string ListCommandHelpText = @".NET List Command @@ -32,7 +32,7 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: reference .NET Core Project-to-Project dependency viewer diff --git a/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs b/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs index c951186a8..fe709ec7a 100644 --- a/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs +++ b/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs @@ -20,7 +20,7 @@ Arguments: Package reference to remove. Options: - -h, --help Show help information + -h, --help Show help information. "; private const string RemoveCommandHelpText = @".NET Remove Command @@ -31,7 +31,7 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: package .NET Remove Package reference Command. diff --git a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs index a64eaa425..239c067c7 100644 --- a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs +++ b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs @@ -22,7 +22,7 @@ Arguments: Project to project references to remove Options: - -h, --help Show help information + -h, --help Show help information. -f, --framework Remove reference only when targeting a specific framework "; @@ -34,7 +34,7 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: package .NET Remove Package reference Command. diff --git a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs index 0ad285f1f..f46487412 100644 --- a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs +++ b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs @@ -24,7 +24,7 @@ Arguments: Add one or more specified projects to the solution. Options: - -h, --help Show help information + -h, --help Show help information. "; private const string SlnCommandHelpText = @".NET modify solution file command @@ -35,7 +35,7 @@ Arguments: Solution file to operate on. If not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: add .NET Add project(s) to a solution file Command @@ -252,7 +252,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln InvalidSolution.sln add {projectToAdd}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -272,7 +272,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } diff --git a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs index 7f8625270..013e620ed 100644 --- a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs +++ b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs @@ -21,7 +21,7 @@ Arguments: Solution file to operate on. If not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. "; private const string SlnCommandHelpText = @".NET modify solution file command @@ -32,7 +32,7 @@ Arguments: Solution file to operate on. If not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: add .NET Add project(s) to a solution file Command @@ -101,7 +101,7 @@ Commands: .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput("sln InvalidSolution.sln list"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -120,7 +120,7 @@ Commands: .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput("sln list"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionFullPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionFullPath}`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } diff --git a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs index 24ac87f04..cfb63556f 100644 --- a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs +++ b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs @@ -22,7 +22,7 @@ Arguments: Remove the specified project(s) from the solution. The project is not impacted. Options: - -h, --help Show help information + -h, --help Show help information. "; private const string SlnCommandHelpText = @".NET modify solution file command @@ -33,7 +33,7 @@ Arguments: Solution file to operate on. If not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. Commands: add .NET Add project(s) to a solution file Command @@ -236,7 +236,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln InvalidSolution.sln remove {projectToRemove}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -256,7 +256,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); }