Refactoring: Move UsageText to a separate file
This commit is contained in:
parent
5e9e688d9e
commit
cddffb08d2
2 changed files with 45 additions and 40 deletions
|
@ -8,53 +8,14 @@ using System.Runtime.InteropServices;
|
|||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using static HelpUsageText;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Help
|
||||
{
|
||||
public class HelpCommand
|
||||
{
|
||||
private static readonly string UsageText = $@"{LocalizableStrings.Usage}: dotnet [host-options] [command] [arguments] [common-options]
|
||||
|
||||
{LocalizableStrings.Arguments}:
|
||||
[command] {LocalizableStrings.CommandDefinition}
|
||||
[arguments] {LocalizableStrings.ArgumentsDefinition}
|
||||
[host-options] {LocalizableStrings.HostOptionsDefinition}
|
||||
[common-options] {LocalizableStrings.OptionsDescription}
|
||||
|
||||
{LocalizableStrings.CommonOptions}:
|
||||
-v|--verbose {LocalizableStrings.VerboseDefinition}
|
||||
-h|--help {LocalizableStrings.HelpDefinition}
|
||||
|
||||
{LocalizableStrings.HostOptions}:
|
||||
-d|--diagnostics {LocalizableStrings.DiagnosticsDefinition}
|
||||
--version {LocalizableStrings.VersionDescription}
|
||||
--info {LocalizableStrings.InfoDescription}
|
||||
|
||||
{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}
|
||||
clean {LocalizableStrings.CleanDefinition}
|
||||
sln {LocalizableStrings.SlnDefinition}
|
||||
|
||||
Project modification commands:
|
||||
add Add items to the project
|
||||
remove Remove items from the project
|
||||
list List items in the project
|
||||
|
||||
{LocalizableStrings.AdvancedCommands}:
|
||||
nuget {LocalizableStrings.NugetDefinition}
|
||||
msbuild {LocalizableStrings.MsBuildDefinition}
|
||||
vstest {LocalizableStrings.VsTestDefinition}";
|
||||
|
||||
public static int Run(string[] args)
|
||||
{
|
||||
|
||||
CommandLineApplication app = new CommandLineApplication(throwOnUnexpectedArg: false);
|
||||
app.Name = "dotnet help";
|
||||
app.FullName = LocalizableStrings.AppFullName;
|
||||
|
|
44
src/dotnet/commands/dotnet-help/HelpUsageText.cs
Normal file
44
src/dotnet/commands/dotnet-help/HelpUsageText.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using Microsoft.DotNet.Tools.Help;
|
||||
|
||||
internal static class HelpUsageText
|
||||
{
|
||||
public static readonly string UsageText =
|
||||
$@"{LocalizableStrings.Usage}: dotnet [host-options] [command] [arguments] [common-options]
|
||||
|
||||
{LocalizableStrings.Arguments}:
|
||||
[command] {LocalizableStrings.CommandDefinition}
|
||||
[arguments] {LocalizableStrings.ArgumentsDefinition}
|
||||
[host-options] {LocalizableStrings.HostOptionsDefinition}
|
||||
[common-options] {LocalizableStrings.OptionsDescription}
|
||||
|
||||
{LocalizableStrings.CommonOptions}:
|
||||
-v|--verbose {LocalizableStrings.VerboseDefinition}
|
||||
-h|--help {LocalizableStrings.HelpDefinition}
|
||||
|
||||
{LocalizableStrings.HostOptions}:
|
||||
-d|--diagnostics {LocalizableStrings.DiagnosticsDefinition}
|
||||
--version {LocalizableStrings.VersionDescription}
|
||||
--info {LocalizableStrings.InfoDescription}
|
||||
|
||||
{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}
|
||||
clean {LocalizableStrings.CleanDefinition}
|
||||
sln {LocalizableStrings.SlnDefinition}
|
||||
|
||||
Project modification commands:
|
||||
add Add items to the project
|
||||
remove Remove items from the project
|
||||
list List items in the project
|
||||
|
||||
{LocalizableStrings.AdvancedCommands}:
|
||||
nuget {LocalizableStrings.NugetDefinition}
|
||||
msbuild {LocalizableStrings.MsBuildDefinition}
|
||||
vstest {LocalizableStrings.VsTestDefinition}";
|
||||
}
|
Loading…
Reference in a new issue