diff --git a/src/dotnet/commands/dotnet-help/HelpCommand.cs b/src/dotnet/commands/dotnet-help/HelpCommand.cs index 728c2da65..19e2f5d9b 100644 --- a/src/dotnet/commands/dotnet-help/HelpCommand.cs +++ b/src/dotnet/commands/dotnet-help/HelpCommand.cs @@ -8,41 +8,41 @@ namespace Microsoft.DotNet.Tools.Help { public class HelpCommand { - private const string UsageText = @"Usage: dotnet [host-options] [command] [arguments] [common-options] + private static readonly string UsageText = $@"{LocalizableStrings.Usage}: dotnet [host-options] [command] [arguments] [common-options] -Arguments: - [command] The command to execute - [arguments] Arguments to pass to the command - [host-options] Options specific to dotnet (host) - [common-options] Options common to all commands +{LocalizableStrings.Arguments}: + [command] {LocalizableStrings.CommandDefinition} + [arguments] {LocalizableStrings.ArgumentsDefinition} + [host-options] {LocalizableStrings.HostOptionsDefinition} + [common-options] {LocalizableStrings.OptionsDescription} -Common options: - -v|--verbose Enable verbose output - -h|--help Show help +{LocalizableStrings.CommonOptions}: + -v|--verbose {LocalizableStrings.VerboseDefinition} + -h|--help {LocalizableStrings.HelpDefinition} -Host options (passed before the command): - -v|--verbose Enable verbose output - --version Display .NET CLI Version Number - --info Display .NET CLI Info +{LocalizableStrings.HostOptions}: + -v|--verbose {LocalizableStrings.VerboseDefinition} + --version {LocalizableStrings.VersionDescription} + --info {LocalizableStrings.InfoDescription} -Commands: - new Initialize a basic .NET project - restore Restore dependencies specified in the .NET project - build Builds a .NET project - publish Publishes a .NET project for deployment (including the runtime) - run Compiles and immediately executes a .NET project - test Runs unit tests using the test runner specified in the project - pack Creates a NuGet package - migrate Migrates a project.json based project to a msbuild based project +{LocalizableStrings.Commands}: + new {LocalizableStrings.NewDefinition} + restore {LocalizableStrings.RestoreDefinition} + build {LocalizableStrings.BuildDefinition} + publish {LocalizableStrings.PublishDefinition} + run {LocalizableStrings.RunDefinition} + test {LocalizableStrings.TestDefinition} + pack {LocalizableStrings.PackDefinition} + migrate {LocalizableStrings.MigrateDefinition} Project modification commands: add Add items to the project remove Remove items from the project -Advanced Commands: - nuget Provides additional NuGet commands - msbuild msbuilds a project and all of its dependencies - vstest Runs tests from the specified files"; +{LocalizableStrings.AdvancedCommands}: + nuget {LocalizableStrings.NugetDefinition} + msbuild {LocalizableStrings.MsBuildDefinition} + vstest {LocalizableStrings.VsTestDefinition}"; public static int Run(string[] args) { diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.cs b/src/dotnet/commands/dotnet-help/LocalizableStrings.cs new file mode 100644 index 000000000..afca05ce8 --- /dev/null +++ b/src/dotnet/commands/dotnet-help/LocalizableStrings.cs @@ -0,0 +1,61 @@ +namespace Microsoft.DotNet.Tools.Help +{ + internal class LocalizableStrings + { + public const string Usage = "Usage"; + + public const string Arguments = "Arguments"; + + public const string CommandDefinition = "The command to execute"; + + public const string ArgumentsDefinition = "Arguments to pass to the command"; + + public const string HostOptionsDefinition = "Options specific to dotnet (host)"; + + public const string OptionsDescription = "Options common to all commands"; + + public const string CommonOptions = "Common options"; + + public const string VerboseDefinition = "Enable verbose output"; + + public const string HelpDefinition = "Show help"; + + public const string HostOptions = "Host options (passed before the command)"; + + public const string VersionDescription = "Display .NET CLI Version Number"; + + public const string InfoDescription = "Display .NET CLI Info"; + + public const string Commands = "Commands"; + + public const string NewDefinition = "Initialize a basic .NET project"; + + public const string RestoreDefinition = "Restore dependencies specified in the.NET project"; + + public const string BuildDefinition = "Builds a .NET project"; + + public const string PublishDefinition = "Publishes a .NET project for deployment (including the runtime)"; + + public const string RunDefinition = "Compiles and immediately executes a.NET project"; + + public const string TestDefinition = "Runs unit tests using the test runner specified in the project"; + + public const string PackDefinition = "Creates a NuGet package"; + + public const string MigrateDefinition = "Migrates a project.json based project to a msbuild based project"; + + public const string ProjectModificationCommands = "Project modification commands"; + + public const string AddDefinition = "Add items to the project"; + + public const string RemoveDefinition = "Remove items from the project"; + + public const string AdvancedCommands = "Advanced Commands"; + + public const string NugetDefinition = "Provides additional NuGet commands"; + + public const string MsBuildDefinition = "msbuilds a project and all of its dependencies"; + + public const string VsTestDefinition = "Runs tests from the specified files"; + } +}