2017-03-06 11:57:19 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
2017-04-05 11:30:45 -07:00
|
|
|
|
using Microsoft.DotNet.Tools.Help;
|
2017-03-21 11:41:09 -07:00
|
|
|
|
using static System.Environment;
|
|
|
|
|
using static Microsoft.DotNet.Cli.CommandLine.LocalizableStrings;
|
|
|
|
|
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
2017-03-06 11:57:19 -08:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
|
{
|
|
|
|
|
public static class Parser
|
|
|
|
|
{
|
2017-03-21 11:41:09 -07:00
|
|
|
|
static Parser()
|
|
|
|
|
{
|
|
|
|
|
ConfigureCommandLineLocalizedStrings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void ConfigureCommandLineLocalizedStrings()
|
|
|
|
|
{
|
|
|
|
|
DefaultHelpViewText.AdditionalArgumentsSection =
|
2017-11-27 22:49:52 -08:00
|
|
|
|
$"{UsageCommandsAdditionalArgsHeader}{NewLine} {LocalizableStrings.RunCommandAdditionalArgsHelpText}";
|
2017-03-21 11:41:09 -07:00
|
|
|
|
DefaultHelpViewText.ArgumentsSection.Title = UsageArgumentsHeader;
|
|
|
|
|
DefaultHelpViewText.CommandsSection.Title = UsageCommandsHeader;
|
|
|
|
|
DefaultHelpViewText.OptionsSection.Title = UsageOptionsHeader;
|
|
|
|
|
DefaultHelpViewText.Synopsis.AdditionalArguments = UsageCommandAdditionalArgs;
|
|
|
|
|
DefaultHelpViewText.Synopsis.Command = UsageCommandToken;
|
|
|
|
|
DefaultHelpViewText.Synopsis.Options = UsageOptionsToken;
|
|
|
|
|
DefaultHelpViewText.Synopsis.Title = UsageHeader;
|
2017-06-27 13:26:14 -07:00
|
|
|
|
|
|
|
|
|
ValidationMessages.Current = new CommandLineValidationMessages();
|
2017-03-21 11:41:09 -07:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-07 16:40:18 -08:00
|
|
|
|
public static CommandLine.Parser Instance { get; } = new CommandLine.Parser(
|
|
|
|
|
options: Create.Command("dotnet",
|
|
|
|
|
".NET Command Line Tools",
|
2017-03-10 17:11:19 -08:00
|
|
|
|
Accept.NoArguments(),
|
2017-03-07 16:40:18 -08:00
|
|
|
|
NewCommandParser.New(),
|
|
|
|
|
RestoreCommandParser.Restore(),
|
|
|
|
|
BuildCommandParser.Build(),
|
|
|
|
|
PublishCommandParser.Publish(),
|
|
|
|
|
RunCommandParser.Run(),
|
|
|
|
|
TestCommandParser.Test(),
|
|
|
|
|
PackCommandParser.Pack(),
|
|
|
|
|
MigrateCommandParser.Migrate(),
|
|
|
|
|
CleanCommandParser.Clean(),
|
|
|
|
|
SlnCommandParser.Sln(),
|
|
|
|
|
AddCommandParser.Add(),
|
|
|
|
|
RemoveCommandParser.Remove(),
|
|
|
|
|
ListCommandParser.List(),
|
|
|
|
|
NuGetCommandParser.NuGet(),
|
2017-04-07 13:11:40 -05:00
|
|
|
|
StoreCommandParser.Store(),
|
2017-04-05 11:30:45 -07:00
|
|
|
|
HelpCommandParser.Help(),
|
2017-03-07 16:40:18 -08:00
|
|
|
|
Create.Command("msbuild", ""),
|
2017-03-21 11:41:09 -07:00
|
|
|
|
Create.Command("vstest", ""),
|
2017-03-07 16:40:18 -08:00
|
|
|
|
CompleteCommandParser.Complete(),
|
2017-06-27 13:46:09 -07:00
|
|
|
|
InternalReportinstallsuccessCommandParser.InternalReportinstallsuccess(),
|
2018-03-21 19:12:32 -07:00
|
|
|
|
ToolCommandParser.Tool(),
|
2017-03-07 16:40:18 -08:00
|
|
|
|
CommonOptions.HelpOption(),
|
|
|
|
|
Create.Option("--info", ""),
|
2017-03-12 15:06:34 -07:00
|
|
|
|
Create.Option("-d", ""),
|
|
|
|
|
Create.Option("--debug", "")));
|
2017-03-06 11:57:19 -08:00
|
|
|
|
}
|
2017-12-04 14:13:24 -08:00
|
|
|
|
}
|