2017-03-06 19:57:19 +00: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-03-21 18:41:09 +00:00
|
|
|
|
using static System.Environment;
|
|
|
|
|
using static Microsoft.DotNet.Cli.CommandLine.LocalizableStrings;
|
|
|
|
|
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
2017-03-06 19:57:19 +00:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
|
{
|
|
|
|
|
public static class Parser
|
|
|
|
|
{
|
2017-03-21 18:41:09 +00:00
|
|
|
|
static Parser()
|
|
|
|
|
{
|
|
|
|
|
ConfigureCommandLineLocalizedStrings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void ConfigureCommandLineLocalizedStrings()
|
|
|
|
|
{
|
|
|
|
|
DefaultHelpViewText.AdditionalArgumentsSection =
|
|
|
|
|
$"{UsageCommandsAdditionalArgsHeader}:{NewLine} {LocalizableStrings.RunCommandAdditionalArgsHelpText}";
|
|
|
|
|
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-03-08 00:40:18 +00:00
|
|
|
|
public static CommandLine.Parser Instance { get; } = new CommandLine.Parser(
|
|
|
|
|
options: Create.Command("dotnet",
|
|
|
|
|
".NET Command Line Tools",
|
2017-03-11 01:11:19 +00:00
|
|
|
|
Accept.NoArguments(),
|
2017-03-08 00:40:18 +00: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-03-10 00:12:08 +00:00
|
|
|
|
CacheCommandParser.Cache(),
|
2017-03-08 00:40:18 +00:00
|
|
|
|
Create.Command("msbuild", ""),
|
2017-03-21 18:41:09 +00:00
|
|
|
|
Create.Command("vstest", ""),
|
2017-03-08 00:40:18 +00:00
|
|
|
|
CompleteCommandParser.Complete(),
|
|
|
|
|
CommonOptions.HelpOption(),
|
|
|
|
|
Create.Option("--info", ""),
|
2017-03-12 22:06:34 +00:00
|
|
|
|
Create.Option("-d", ""),
|
|
|
|
|
Create.Option("--debug", "")));
|
2017-03-06 19:57:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|