From 5a564e2e9f23b7847024baf027117538ade67fca Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 18 Nov 2022 22:09:41 +0000 Subject: [PATCH 01/82] Update dependencies from https://github.com/dotnet/command-line-api build 20221114.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.356402 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a2a37bbe8ccc..dc23e012dcc9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 83c80bfbd2d283405d94af5e4bb496bf7d185b01 - + https://github.com/dotnet/command-line-api - 8374d5fca634a93458c84414b1604c12f765d1ab + 9266d5c92885a2a616e656274a345a2f8157569b - + https://github.com/dotnet/command-line-api - 8374d5fca634a93458c84414b1604c12f765d1ab + 9266d5c92885a2a616e656274a345a2f8157569b diff --git a/eng/Versions.props b/eng/Versions.props index e361a16b1793..4c4daee506de 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.22559.2 4.6.0 - 2.0.0-beta4.22564.1 + 2.0.0-beta4.22564.2 1.0.0-preview5.1.22263.1 3.0.4496 From 33ae728645182b49c19d6f3821e64a894d3c4d42 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 18 Nov 2022 23:34:02 +0000 Subject: [PATCH 02/82] Update dependencies from https://github.com/dotnet/command-line-api build 20221118.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.356801 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dc23e012dcc9..7aa8aeecaf3c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 83c80bfbd2d283405d94af5e4bb496bf7d185b01 - + https://github.com/dotnet/command-line-api - 9266d5c92885a2a616e656274a345a2f8157569b + 350a618ab44932c568ae2392d7a571281baed59a - + https://github.com/dotnet/command-line-api - 9266d5c92885a2a616e656274a345a2f8157569b + 350a618ab44932c568ae2392d7a571281baed59a diff --git a/eng/Versions.props b/eng/Versions.props index 4c4daee506de..23ead1a65533 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.22559.2 4.6.0 - 2.0.0-beta4.22564.2 + 2.0.0-beta4.22568.1 1.0.0-preview5.1.22263.1 3.0.4496 From 5981597e9beaf64a517c5e34986dcca3bec43a36 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 13 Dec 2022 15:17:15 +0000 Subject: [PATCH 03/82] Update dependencies from https://github.com/dotnet/command-line-api build 20221213.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.361301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7aa8aeecaf3c..a20e1614522e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 83c80bfbd2d283405d94af5e4bb496bf7d185b01 - + https://github.com/dotnet/command-line-api - 350a618ab44932c568ae2392d7a571281baed59a + cd7b452191629397ea3c1fbc6e7f6c0f4cf36dce - + https://github.com/dotnet/command-line-api - 350a618ab44932c568ae2392d7a571281baed59a + cd7b452191629397ea3c1fbc6e7f6c0f4cf36dce diff --git a/eng/Versions.props b/eng/Versions.props index 23ead1a65533..258385b75668 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.22559.2 4.6.0 - 2.0.0-beta4.22568.1 + 2.0.0-beta4.22613.1 1.0.0-preview5.1.22263.1 3.0.4496 From 68dda8a373aeb7bd255428cf7d4ea32ad697138c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 19 Jan 2023 23:11:05 +0000 Subject: [PATCH 04/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230119.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.406902 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a20e1614522e..bb0599c0ee8a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 83c80bfbd2d283405d94af5e4bb496bf7d185b01 - + https://github.com/dotnet/command-line-api - cd7b452191629397ea3c1fbc6e7f6c0f4cf36dce + 17ba8754454ce100f23994d83eaa75c6acba35ae - + https://github.com/dotnet/command-line-api - cd7b452191629397ea3c1fbc6e7f6c0f4cf36dce + 17ba8754454ce100f23994d83eaa75c6acba35ae diff --git a/eng/Versions.props b/eng/Versions.props index 258385b75668..5efb0df5284e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.22559.2 4.6.0 - 2.0.0-beta4.22613.1 + 2.0.0-beta4.23069.2 1.0.0-preview5.1.22263.1 3.0.4496 From fa49eaef848e859a67b4d47ae2b4a8d95e7cfe46 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 20 Jan 2023 12:15:05 +0100 Subject: [PATCH 05/82] adopt to recent breaking changes: renames, removal of extension methods --- .../Program.cs | 36 +++--- src/BuiltInTools/dotnet-watch/Program.cs | 2 +- .../Commands/BaseCommand.cs | 6 +- .../Commands/Extensions.cs | 4 +- .../Commands/NewCommand.Legacy.cs | 32 +++-- .../Commands/NewCommand.cs | 12 +- .../Commands/create/InstantiateCommand.cs | 30 ++--- .../Commands/create/TemplateCommand.cs | 22 ++-- .../Commands/install/BaseInstallCommand.cs | 8 +- .../Commands/list/BaseListCommand.cs | 8 +- .../Commands/list/LegacyListCommand.cs | 5 +- .../Commands/search/BaseSearchCommand.cs | 2 +- .../Commands/search/LegacySearchCommand.cs | 5 +- .../uninstall/BaseUninstallCommand.cs | 2 +- .../Commands/update/BaseUpdateCommand.cs | 4 +- .../Commands/update/UpdateCommand.cs | 2 +- src/Cli/dotnet-new3/CompleteCommand.cs | 4 +- src/Cli/dotnet-new3/New3CommandFactory.cs | 2 +- src/Cli/dotnet-new3/Program.cs | 2 +- src/Cli/dotnet/CommonOptions.cs | 14 ++- src/Cli/dotnet/ParseResultExtensions.cs | 2 +- src/Cli/dotnet/Parser.cs | 16 +-- .../Telemetry/AllowListToSendFirstArgument.cs | 8 +- .../commands/InstallingWorkloadCommand.cs | 16 +-- .../commands/dotnet-add/AddCommandParser.cs | 6 +- .../dotnet-add-package/AddPackageParser.cs | 16 +-- .../AddProjectToProjectReferenceParser.cs | 6 +- .../dotnet-build/BuildCommandParser.cs | 36 +++--- .../BuildServerCommandParser.cs | 2 +- .../BuildServerShutdownCommandParser.cs | 6 +- .../dotnet-clean/CleanCommandParser.cs | 16 +-- .../dotnet-complete/CompleteCommandParser.cs | 4 +- .../commands/dotnet-help/HelpCommandParser.cs | 2 +- ...ternalReportinstallsuccessCommandParser.cs | 2 +- .../commands/dotnet-list/ListCommandParser.cs | 6 +- .../ListPackageReferencesCommandParser.cs | 24 ++-- ...ProjectToProjectReferencesCommandParser.cs | 2 +- .../dotnet-nuget/NuGetCommandParser.cs | 118 +++++++++--------- .../commands/dotnet-pack/PackCommandParser.cs | 24 ++-- .../dotnet-publish/PublishCommandParser.cs | 34 ++--- .../dotnet-remove/RemoveCommandParser.cs | 6 +- .../RemovePackageParser.cs | 4 +- .../RemoveProjectToProjectReferenceParser.cs | 4 +- .../dotnet-restore/RestoreCommandParser.cs | 8 +- .../commands/dotnet-run/RunCommandParser.cs | 34 ++--- .../commands/dotnet-sdk/SdkCommandParser.cs | 2 +- .../commands/dotnet-sln/SlnCommandParser.cs | 8 +- .../commands/dotnet-sln/add/SlnAddParser.cs | 6 +- .../dotnet-sln/remove/SlnRemoveParser.cs | 2 +- .../dotnet-store/StoreCommandParser.cs | 22 ++-- .../commands/dotnet-test/TestCommandParser.cs | 86 +++++++------ .../commands/dotnet-tool/ToolCommandParser.cs | 14 +-- .../install/ToolInstallCommandParser.cs | 32 ++--- .../dotnet-tool/list/ToolListCommandParser.cs | 8 +- .../restore/ToolRestoreCommandParser.cs | 16 +-- .../dotnet-tool/run/ToolRunCommandParser.cs | 4 +- .../search/ToolSearchCommandParser.cs | 10 +- .../uninstall/ToolUninstallCommandParser.cs | 10 +- .../update/ToolUpdateCommandParser.cs | 30 ++--- .../dotnet-vstest/VSTestCommandParser.cs | 6 +- ...dCommandNuGetRestoreActionConfigOptions.cs | 8 +- .../dotnet-workload/WorkloadCommandParser.cs | 18 +-- .../install/WorkloadInstallCommandParser.cs | 10 +- .../list/WorkloadListCommandParser.cs | 10 +- .../repair/WorkloadRepairCommandParser.cs | 10 +- .../restore/WorkloadRestoreCommandParser.cs | 2 +- .../search/WorkloadSearchCommandParser.cs | 6 +- .../WorkloadUninstallCommandParser.cs | 4 +- .../update/WorkloadUpdateCommandParser.cs | 12 +- .../ParserTests/InstantiateTests.cs | 4 +- .../TabularOutputTests.cs | 3 +- 71 files changed, 497 insertions(+), 450 deletions(-) diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs index 25544c72da48..fdf9fa7d42ca 100644 --- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs +++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs @@ -113,14 +113,14 @@ static int Main(string[] args) rootCommand.AddGlobalOption(excludeAttributesFilesOption); rootCommand.AddGlobalOption(enableRuleCannotChangeParameterNameOption); - rootCommand.AddOption(leftAssembliesOption); - rootCommand.AddOption(rightAssembliesOption); - rootCommand.AddOption(strictModeOption); - rootCommand.AddOption(leftAssembliesReferencesOption); - rootCommand.AddOption(rightAssembliesReferencesOption); - rootCommand.AddOption(createWorkItemPerAssemblyOption); - rootCommand.AddOption(leftAssembliesTransformationPatternOption); - rootCommand.AddOption(rightAssembliesTransformationPatternOption); + rootCommand.Options.Add(leftAssembliesOption); + rootCommand.Options.Add(rightAssembliesOption); + rootCommand.Options.Add(strictModeOption); + rootCommand.Options.Add(leftAssembliesReferencesOption); + rootCommand.Options.Add(rightAssembliesReferencesOption); + rootCommand.Options.Add(createWorkItemPerAssemblyOption); + rootCommand.Options.Add(leftAssembliesTransformationPatternOption); + rootCommand.Options.Add(rightAssembliesTransformationPatternOption); rootCommand.SetHandler((InvocationContext context) => { @@ -211,15 +211,15 @@ static int Main(string[] args) }; Command packageCommand = new("package", "Validates the compatibility of package assets"); - packageCommand.AddArgument(packageArgument); - packageCommand.AddOption(runtimeGraphOption); - packageCommand.AddOption(runApiCompatOption); - packageCommand.AddOption(enableStrictModeForCompatibleTfmsOption); - packageCommand.AddOption(enableStrictModeForCompatibleFrameworksInPackageOption); - packageCommand.AddOption(enableStrictModeForBaselineValidationOption); - packageCommand.AddOption(baselinePackageOption); - packageCommand.AddOption(packageAssemblyReferencesOption); - packageCommand.AddOption(baselinePackageAssemblyReferencesOption); + packageCommand.Arguments.Add(packageArgument); + packageCommand.Options.Add(runtimeGraphOption); + packageCommand.Options.Add(runApiCompatOption); + packageCommand.Options.Add(enableStrictModeForCompatibleTfmsOption); + packageCommand.Options.Add(enableStrictModeForCompatibleFrameworksInPackageOption); + packageCommand.Options.Add(enableStrictModeForBaselineValidationOption); + packageCommand.Options.Add(baselinePackageOption); + packageCommand.Options.Add(packageAssemblyReferencesOption); + packageCommand.Options.Add(baselinePackageAssemblyReferencesOption); packageCommand.SetHandler((InvocationContext context) => { // If a roslyn assemblies path isn't provided, use the compiled against version from a subfolder. @@ -268,7 +268,7 @@ static int Main(string[] args) roslynResolver.Unregister(); }); - rootCommand.AddCommand(packageCommand); + rootCommand.Subcommands.Add(packageCommand); return rootCommand.Invoke(args); } diff --git a/src/BuiltInTools/dotnet-watch/Program.cs b/src/BuiltInTools/dotnet-watch/Program.cs index 21219eb2388e..7a4a0ecebe05 100644 --- a/src/BuiltInTools/dotnet-watch/Program.cs +++ b/src/BuiltInTools/dotnet-watch/Program.cs @@ -138,7 +138,7 @@ internal static RootCommand CreateRootCommand(Func new[] { "--verbose", "-v" }, "Show verbose output"); - verbose.AddValidator(v => + verbose.Validators.Add(v => { if (v.FindResultFor(quiet) is not null && v.FindResultFor(verbose) is not null) { diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs index a309ed663db4..e1e7484c5015 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs @@ -190,7 +190,7 @@ protected IReadOnlyDictionary SetupFilterOptions foreach (FilterOptionDefinition filterDef in filtersToSetup) { Option newOption = GetFilterOption(filterDef); - this.AddOption(newOption); + this.Options.Add(newOption); options[filterDef] = newOption; } return options; @@ -201,8 +201,8 @@ protected IReadOnlyDictionary SetupFilterOptions /// protected void SetupTabularOutputOptions(ITabularOutputCommand command) { - this.AddOption(command.ColumnsAllOption); - this.AddOption(command.ColumnsOption); + this.Options.Add(command.ColumnsAllOption); + this.Options.Add(command.ColumnsOption); } private static async Task HandleGlobalOptionsAsync( diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs index 5042ca88194a..a1587e4706fc 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs @@ -51,8 +51,8 @@ internal static bool HasErrorFor(this ParseResult parseResult, Option option) internal static void FromAmongCaseInsensitive(this Option option, string[]? allowedValues = null, string? allowedHiddenValue = null) { allowedValues ??= Array.Empty(); - option.AddValidator(optionResult => ValidateAllowedValues(optionResult, allowedValues, allowedHiddenValue)); - option.AddCompletions(allowedValues); + option.Validators.Add(optionResult => ValidateAllowedValues(optionResult, allowedValues, allowedHiddenValue)); + option.CompletionSources.Add(allowedValues); } /// diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.Legacy.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.Legacy.cs index f36bab1db977..f795801bd7da 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.Legacy.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.Legacy.cs @@ -54,7 +54,7 @@ internal void AddNoLegacyUsageValidators(Command command, params Symbol[] except { if (!except.Contains(option)) { - command.AddValidator(symbolResult => ValidateOptionUsage(symbolResult, option)); + command.Validators.Add(symbolResult => ValidateOptionUsage(symbolResult, option)); } } @@ -62,7 +62,7 @@ internal void AddNoLegacyUsageValidators(Command command, params Symbol[] except { if (!except.Contains(argument)) { - command.AddValidator(symbolResult => ValidateArgumentUsage(symbolResult, argument)); + command.Validators.Add(symbolResult => ValidateArgumentUsage(symbolResult, argument)); } } } @@ -79,7 +79,12 @@ internal void ValidateArgumentsAreNotUsed(CommandResult commandResult) internal void ValidateOptionUsage(CommandResult commandResult, Option option) { - OptionResult? optionResult = commandResult.Parent?.Children.FirstOrDefault(symbol => symbol.Symbol == option) as OptionResult; + if (commandResult.Parent is not CommandResult parentResult) + { + return; + } + + OptionResult? optionResult = parentResult.Children.OfType().FirstOrDefault(result => result.Option == option); if (optionResult != null) { List wrongTokens = new List(); @@ -101,10 +106,15 @@ internal void ValidateOptionUsage(CommandResult commandResult, Option option) private static void ValidateArgumentUsage(CommandResult commandResult, params Argument[] arguments) { + if (commandResult.Parent is not CommandResult parentResult) + { + return; + } + List wrongTokens = new List(); foreach (Argument argument in arguments) { - var newCommandArgument = commandResult.Parent?.Children.FirstOrDefault(symbol => symbol.Symbol == argument) as ArgumentResult; + var newCommandArgument = parentResult.Children.OfType().FirstOrDefault(result => result.Argument == argument); if (newCommandArgument == null) { continue; @@ -126,22 +136,22 @@ private static void ValidateArgumentUsage(CommandResult commandResult, params Ar private void BuildLegacySymbols(Func hostBuilder) { - this.AddArgument(ShortNameArgument); - this.AddArgument(RemainingArguments); + this.Arguments.Add(ShortNameArgument); + this.Arguments.Add(RemainingArguments); //legacy options Dictionary options = new Dictionary(); foreach (var filterDef in LegacyFilterDefinitions) { options[filterDef] = filterDef.OptionFactory().AsHidden(); - this.AddOption(options[filterDef]); + this.Options.Add(options[filterDef]); } LegacyFilters = options; - this.AddOption(InteractiveOption); - this.AddOption(AddSourceOption); - this.AddOption(ColumnsAllOption); - this.AddOption(ColumnsOption); + this.Options.Add(InteractiveOption); + this.Options.Add(AddSourceOption); + this.Options.Add(ColumnsAllOption); + this.Options.Add(ColumnsOption); this.TreatUnmatchedTokensAsErrors = true; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs index 90d573b3300b..eea4799f83c8 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs @@ -37,12 +37,12 @@ internal NewCommand( this.AddGlobalOption(DebugRebuildCacheOption); this.AddGlobalOption(DebugShowConfigOption); - this.AddOption(SharedOptions.OutputOption); - this.AddOption(SharedOptions.NameOption); - this.AddOption(SharedOptions.DryRunOption); - this.AddOption(SharedOptions.ForceOption); - this.AddOption(SharedOptions.NoUpdateCheckOption); - this.AddOption(SharedOptions.ProjectPathOption); + this.Options.Add(SharedOptions.OutputOption); + this.Options.Add(SharedOptions.NameOption); + this.Options.Add(SharedOptions.DryRunOption); + this.Options.Add(SharedOptions.ForceOption); + this.Options.Add(SharedOptions.NoUpdateCheckOption); + this.Options.Add(SharedOptions.ProjectPathOption); } internal static Option DebugCustomSettingsLocationOption { get; } = new("--debug:custom-hive") diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs index 2203b26f79c0..615f50109d61 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs @@ -22,23 +22,23 @@ internal InstantiateCommand( Func hostBuilder) : base(hostBuilder, "create", SymbolStrings.Command_Instantiate_Description) { - this.AddArgument(ShortNameArgument); - this.AddArgument(RemainingArguments); + this.Arguments.Add(ShortNameArgument); + this.Arguments.Add(RemainingArguments); - this.AddOption(SharedOptions.OutputOption); - this.AddOption(SharedOptions.NameOption); - this.AddOption(SharedOptions.DryRunOption); - this.AddOption(SharedOptions.ForceOption); - this.AddOption(SharedOptions.NoUpdateCheckOption); - this.AddOption(SharedOptions.ProjectPathOption); + this.Options.Add(SharedOptions.OutputOption); + this.Options.Add(SharedOptions.NameOption); + this.Options.Add(SharedOptions.DryRunOption); + this.Options.Add(SharedOptions.ForceOption); + this.Options.Add(SharedOptions.NoUpdateCheckOption); + this.Options.Add(SharedOptions.ProjectPathOption); parentCommand.AddNoLegacyUsageValidators(this); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.OutputOption)); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.NameOption)); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.DryRunOption)); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.ForceOption)); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.NoUpdateCheckOption)); - this.AddValidator(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.ProjectPathOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.OutputOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.NameOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.DryRunOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.ForceOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.NoUpdateCheckOption)); + this.Validators.Add(symbolResult => parentCommand.ValidateOptionUsage(symbolResult, SharedOptions.ProjectPathOption)); } internal static Argument ShortNameArgument { get; } = new Argument("template-short-name") @@ -272,7 +272,7 @@ private static async Task HandleTemplateInstantationAsync( if (candidates.Count == 1) { TemplateCommand templateCommandToRun = candidates.Single(); - args.Command.AddCommand(templateCommandToRun); + args.Command.Subcommands.Add(templateCommandToRun); ParseResult updatedParseResult = args.ParseResult.Parser.Parse(args.ParseResult.Tokens.Select(t => t.Value).ToList()); return await candidates.Single().InvokeAsync(updatedParseResult, cancellationToken).ConfigureAwait(false); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateCommand.cs index af6125530fd7..22ee073074b8 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateCommand.cs @@ -51,11 +51,11 @@ public TemplateCommand( AddAlias(item); } - this.AddOption(SharedOptions.OutputOption); - this.AddOption(SharedOptions.NameOption); - this.AddOption(SharedOptions.DryRunOption); - this.AddOption(SharedOptions.ForceOption); - this.AddOption(SharedOptions.NoUpdateCheckOption); + this.Options.Add(SharedOptions.OutputOption); + this.Options.Add(SharedOptions.NameOption); + this.Options.Add(SharedOptions.DryRunOption); + this.Options.Add(SharedOptions.ForceOption); + this.Options.Add(SharedOptions.NoUpdateCheckOption); string? templateLanguage = template.GetLanguage(); string? defaultLanguage = environmentSettings.GetDefaultLanguage(); @@ -69,7 +69,7 @@ public TemplateCommand( && buildDefaultLanguageValidation) { LanguageOption.SetDefaultValue(defaultLanguage); - LanguageOption.AddValidator(optionResult => + LanguageOption.Validators.Add(optionResult => { var value = optionResult.GetValueOrDefault(); if (value != template.GetLanguage()) @@ -79,7 +79,7 @@ public TemplateCommand( } ); } - this.AddOption(LanguageOption); + this.Options.Add(LanguageOption); } string? templateType = template.GetTemplateType(); @@ -89,7 +89,7 @@ public TemplateCommand( TypeOption = SharedOptionsFactory.CreateTypeOption(); TypeOption.Description = SymbolStrings.TemplateCommand_Option_Type; TypeOption.FromAmongCaseInsensitive(new[] { templateType }); - this.AddOption(TypeOption); + this.Options.Add(TypeOption); } if (template.BaselineInfo.Any(b => !string.IsNullOrWhiteSpace(b.Key))) @@ -97,7 +97,7 @@ public TemplateCommand( BaselineOption = SharedOptionsFactory.CreateBaselineOption(); BaselineOption.Description = SymbolStrings.TemplateCommand_Option_Baseline; BaselineOption.FromAmongCaseInsensitive(template.BaselineInfo.Select(b => b.Key).Where(b => !string.IsNullOrWhiteSpace(b)).ToArray()); - this.AddOption(BaselineOption); + this.Options.Add(BaselineOption); } if (HasRunScriptPostActionDefined(template)) @@ -108,7 +108,7 @@ public TemplateCommand( Arity = new ArgumentArity(1, 1) }; AllowScriptsOption.SetDefaultValue(AllowRunScripts.Prompt); - this.AddOption(AllowScriptsOption); + this.Options.Add(AllowScriptsOption); } AddTemplateOptionsToCommand(template); @@ -301,7 +301,7 @@ private void AddTemplateOptionsToCommand(CliTemplateInfo templateInfo) foreach ((CliTemplateParameter parameter, IReadOnlySet aliases, IReadOnlyList _) in parametersWithAliasAssignments) { TemplateOption option = new TemplateOption(parameter, aliases); - this.AddOption(option.Option); + this.Options.Add(option.Option); _templateSpecificOptions[parameter.Name] = option; } } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/BaseInstallCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/BaseInstallCommand.cs index c7f83a47c302..3c2746b1de76 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/BaseInstallCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/BaseInstallCommand.cs @@ -18,10 +18,10 @@ internal BaseInstallCommand( : base(hostBuilder, commandName, SymbolStrings.Command_Install_Description) { ParentCommand = parentCommand; - this.AddArgument(NameArgument); - this.AddOption(InteractiveOption); - this.AddOption(AddSourceOption); - this.AddOption(ForceOption); + this.Arguments.Add(NameArgument); + this.Options.Add(InteractiveOption); + this.Options.Add(AddSourceOption); + this.Options.Add(ForceOption); } internal static Argument NameArgument { get; } = new("package") diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/BaseListCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/BaseListCommand.cs index abef38ad2e0f..d2a71a2ccd85 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/BaseListCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/BaseListCommand.cs @@ -29,10 +29,10 @@ internal BaseListCommand( ParentCommand = parentCommand; Filters = SetupFilterOptions(SupportedFilters); - this.AddArgument(NameArgument); - this.AddOption(IgnoreConstraintsOption); - this.AddOption(SharedOptions.OutputOption); - this.AddOption(SharedOptions.ProjectPathOption); + this.Arguments.Add(NameArgument); + this.Options.Add(IgnoreConstraintsOption); + this.Options.Add(SharedOptions.OutputOption); + this.Options.Add(SharedOptions.ProjectPathOption); SetupTabularOutputOptions(this); } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs index d372829028d1..6b770a739791 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs @@ -19,7 +19,7 @@ public LegacyListCommand( { this.IsHidden = true; this.AddAlias("-l"); - AddValidator(ValidateParentCommandArguments); + this.Validators.Add(ValidateParentCommandArguments); parentCommand.AddNoLegacyUsageValidators(this, except: Filters.Values.Concat(new Symbol[] { ColumnsAllOption, ColumnsOption, NewCommand.ShortNameArgument }).ToArray()); } @@ -41,7 +41,8 @@ protected override Task ExecuteAsync(ListCommandArgs args, IEn private void ValidateParentCommandArguments(CommandResult commandResult) { - var nameArgumentResult = commandResult.Children.FirstOrDefault(symbol => symbol.Symbol == ListCommand.NameArgument); + var nameArgumentResult = commandResult.Children.FirstOrDefault( + symbol => symbol is ArgumentResult argumentResult && argumentResult.Argument == ListCommand.NameArgument); if (nameArgumentResult == null) { return; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/BaseSearchCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/BaseSearchCommand.cs index 05bb47685841..13bb5dd91779 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/BaseSearchCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/BaseSearchCommand.cs @@ -31,7 +31,7 @@ internal BaseSearchCommand( ParentCommand = parentCommand; Filters = SetupFilterOptions(SupportedFilters); - this.AddArgument(NameArgument); + this.Arguments.Add(NameArgument); SetupTabularOutputOptions(this); } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/LegacySearchCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/LegacySearchCommand.cs index 13ed23f49f90..f5eb3dfe18d4 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/LegacySearchCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/search/LegacySearchCommand.cs @@ -16,7 +16,7 @@ public LegacySearchCommand(NewCommand parentCommand, Func ExecuteAsync(SearchCommandArgs args, I private void ValidateParentCommandArguments(CommandResult commandResult) { - var nameArgumentResult = commandResult.Children.FirstOrDefault(symbol => symbol.Symbol == NameArgument); + var nameArgumentResult = commandResult.Children.FirstOrDefault( + symbol => symbol is ArgumentResult argumentResult && argumentResult.Argument == NameArgument); if (nameArgumentResult == null) { return; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/uninstall/BaseUninstallCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/uninstall/BaseUninstallCommand.cs index f3a7e2a9a2c9..78802e585e07 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/uninstall/BaseUninstallCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/uninstall/BaseUninstallCommand.cs @@ -16,7 +16,7 @@ internal BaseUninstallCommand( string commandName) : base(hostBuilder, commandName, SymbolStrings.Command_Uninstall_Description) { - this.AddArgument(NameArgument); + this.Arguments.Add(NameArgument); } internal static Argument NameArgument { get; } = new("package") diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/BaseUpdateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/BaseUpdateCommand.cs index b0ed23004296..5c409eaa4698 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/BaseUpdateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/BaseUpdateCommand.cs @@ -19,8 +19,8 @@ internal BaseUpdateCommand( : base(hostBuilder, commandName, description) { ParentCommand = parentCommand; - this.AddOption(InteractiveOption); - this.AddOption(AddSourceOption); + this.Options.Add(InteractiveOption); + this.Options.Add(AddSourceOption); } internal virtual Option InteractiveOption { get; } = SharedOptionsFactory.CreateInteractiveOption(); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/UpdateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/UpdateCommand.cs index ffcffc75b32f..46ac85b62123 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/UpdateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/update/UpdateCommand.cs @@ -17,7 +17,7 @@ public UpdateCommand( : base(parentCommand, hostBuilder, "update", SymbolStrings.Command_Update_Description) { parentCommand.AddNoLegacyUsageValidators(this); - this.AddOption(CheckOnlyOption); + this.Options.Add(CheckOnlyOption); } internal static Option CheckOnlyOption { get; } = new(new[] { "--check-only", "--dry-run" }) diff --git a/src/Cli/dotnet-new3/CompleteCommand.cs b/src/Cli/dotnet-new3/CompleteCommand.cs index e5c8c07e480b..5111e78fab5c 100644 --- a/src/Cli/dotnet-new3/CompleteCommand.cs +++ b/src/Cli/dotnet-new3/CompleteCommand.cs @@ -24,8 +24,8 @@ internal class CompleteCommand : Command internal CompleteCommand() : base("complete", "tab completion") { - this.AddArgument(PathArgument); - this.AddOption(PositionOption); + this.Arguments.Add(PathArgument); + this.Options.Add(PositionOption); this.SetHandler((InvocationContext invocationContext) => Run(invocationContext.ParseResult)); this.IsHidden = true; diff --git a/src/Cli/dotnet-new3/New3CommandFactory.cs b/src/Cli/dotnet-new3/New3CommandFactory.cs index 5ab2e0e616c9..0c0af21432ca 100644 --- a/src/Cli/dotnet-new3/New3CommandFactory.cs +++ b/src/Cli/dotnet-new3/New3CommandFactory.cs @@ -34,7 +34,7 @@ internal static Command Create() newCommand.AddGlobalOption(_debugEmitTelemetryOption); newCommand.AddGlobalOption(_debugDisableBuiltInTemplatesOption); - newCommand.AddCommand(new CompleteCommand()); + newCommand.Subcommands.Add(new CompleteCommand()); return newCommand; } } diff --git a/src/Cli/dotnet-new3/Program.cs b/src/Cli/dotnet-new3/Program.cs index b621590385e0..3dbe681d64ee 100644 --- a/src/Cli/dotnet-new3/Program.cs +++ b/src/Cli/dotnet-new3/Program.cs @@ -25,7 +25,7 @@ public static Task Main(string[] args) } RootCommand rootCommand = new RootCommand(); - rootCommand.AddCommand(New3CommandFactory.Create()); + rootCommand.Subcommands.Add(New3CommandFactory.Create()); return ParserFactory.CreateParser(rootCommand).Parse(args).InvokeAsync(); } } diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index 8e9297557bc4..db8fc5c0b24c 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -94,7 +94,7 @@ public static Option ConfigurationOption(string description) => ArgumentHelpName = CommonLocalizableStrings.VersionSuffixArgumentName }.ForwardAsSingle(o => $"-property:VersionSuffix={o}"); - public static Argument DefaultToCurrentDirectory(this Argument arg) + public static Argument DefaultToCurrentDirectory(this Argument arg) { arg.SetDefaultValue(PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory())); return arg; @@ -263,6 +263,18 @@ private static bool UserSpecifiedRidOption(ParseResult parseResult) => parseResult.HasOption(ArchitectureOption) || parseResult.HasOption(LongFormArchitectureOption) || parseResult.HasOption(OperatingSystemOption); + + internal static Option AddCompletions(this Option option, Func> completionSource) + { + option.CompletionSources.Add(completionSource); + return option; + } + + internal static Argument AddCompletions(this Argument argument, Func> completionSource) + { + argument.CompletionSources.Add(completionSource); + return argument; + } } public enum VerbosityOptions diff --git a/src/Cli/dotnet/ParseResultExtensions.cs b/src/Cli/dotnet/ParseResultExtensions.cs index 41353fd99d3b..733daf90b758 100644 --- a/src/Cli/dotnet/ParseResultExtensions.cs +++ b/src/Cli/dotnet/ParseResultExtensions.cs @@ -115,7 +115,7 @@ private static string GetSymbolResultValue(ParseResult parseResult, SymbolResult } else if (symbolResult.Token().Type.Equals(TokenType.Command)) { - return symbolResult.Symbol.Name; + return ((System.CommandLine.Parsing.CommandResult)symbolResult).Command.Name; } else if (symbolResult.Token().Type.Equals(TokenType.Argument)) { diff --git a/src/Cli/dotnet/Parser.cs b/src/Cli/dotnet/Parser.cs index 537aa5e893b7..9d4b0ac2e3bd 100644 --- a/src/Cli/dotnet/Parser.cs +++ b/src/Cli/dotnet/Parser.cs @@ -80,18 +80,18 @@ private static Command ConfigureCommandLine(Command rootCommand) // Add subcommands foreach (var subcommand in Subcommands) { - rootCommand.AddCommand(subcommand); + rootCommand.Subcommands.Add(subcommand); } // Add options - rootCommand.AddOption(DiagOption); - rootCommand.AddOption(VersionOption); - rootCommand.AddOption(InfoOption); - rootCommand.AddOption(ListSdksOption); - rootCommand.AddOption(ListRuntimesOption); + rootCommand.Options.Add(DiagOption); + rootCommand.Options.Add(VersionOption); + rootCommand.Options.Add(InfoOption); + rootCommand.Options.Add(ListSdksOption); + rootCommand.Options.Add(ListRuntimesOption); // Add argument - rootCommand.AddArgument(DotnetSubCommand); + rootCommand.Arguments.Add(DotnetSubCommand); return rootCommand; } @@ -336,7 +336,7 @@ public override void Write(HelpContext context) else if (command.Name.Equals(AddPackageParser.GetCommand().Name) || command.Name.Equals(AddCommandParser.GetCommand().Name)) { // Don't show package completions in help - AddPackageParser.CmdPackageArgument.Completions.Clear(); + AddPackageParser.CmdPackageArgument.CompletionSources.Clear(); } base.Write(context); diff --git a/src/Cli/dotnet/Telemetry/AllowListToSendFirstArgument.cs b/src/Cli/dotnet/Telemetry/AllowListToSendFirstArgument.cs index a4d19e88ec7e..f802a6b45888 100644 --- a/src/Cli/dotnet/Telemetry/AllowListToSendFirstArgument.cs +++ b/src/Cli/dotnet/Telemetry/AllowListToSendFirstArgument.cs @@ -22,7 +22,13 @@ public AllowListToSendFirstArgument( public List AllowList(ParseResult parseResult, Dictionary measurements = null) { var result = new List(); - var topLevelCommandNameFromParse = parseResult.RootCommandResult.Children.FirstOrDefault()?.Symbol.Name; + var topLevelCommandNameFromParse = parseResult.RootCommandResult.Children.FirstOrDefault() switch + { + System.CommandLine.Parsing.CommandResult commandResult => commandResult.Command.Name, + OptionResult optionResult => optionResult.Option.Name, + ArgumentResult argumentResult => argumentResult.Argument.Name, + _ => null + }; if (topLevelCommandNameFromParse != null) { if (_topLevelCommandNameAllowList.Contains(topLevelCommandNameFromParse)) diff --git a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs index 89c8734b5041..d298dc2e7971 100644 --- a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs +++ b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs @@ -232,14 +232,14 @@ internal static class InstallingWorkloadCommandParser internal static void AddWorkloadInstallCommandOptions(Command command) { - command.AddOption(VersionOption); - command.AddOption(ConfigOption); - command.AddOption(SourceOption); - command.AddOption(PrintDownloadLinkOnlyOption); - command.AddOption(FromCacheOption); - command.AddOption(DownloadToCacheOption); - command.AddOption(IncludePreviewOption); - command.AddOption(FromRollbackFileOption); + command.Options.Add(VersionOption); + command.Options.Add(ConfigOption); + command.Options.Add(SourceOption); + command.Options.Add(PrintDownloadLinkOnlyOption); + command.Options.Add(FromCacheOption); + command.Options.Add(DownloadToCacheOption); + command.Options.Add(IncludePreviewOption); + command.Options.Add(FromRollbackFileOption); } } } diff --git a/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs b/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs index 9a14efa05b96..7c772235f23a 100644 --- a/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs @@ -29,9 +29,9 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("add", DocsLink, LocalizableStrings.NetAddCommand); - command.AddArgument(ProjectArgument); - command.AddCommand(AddPackageParser.GetCommand()); - command.AddCommand(AddProjectToProjectReferenceParser.GetCommand()); + command.Arguments.Add(ProjectArgument); + command.Subcommands.Add(AddPackageParser.GetCommand()); + command.Subcommands.Add(AddProjectToProjectReferenceParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs b/src/Cli/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs index a9a52b193e80..ab540d4e1b60 100644 --- a/src/Cli/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs +++ b/src/Cli/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs @@ -62,14 +62,14 @@ private static Command ConstructCommand() { var command = new Command("package", LocalizableStrings.AppFullName); - command.AddArgument(CmdPackageArgument); - command.AddOption(VersionOption); - command.AddOption(FrameworkOption); - command.AddOption(NoRestoreOption); - command.AddOption(SourceOption); - command.AddOption(PackageDirOption); - command.AddOption(InteractiveOption); - command.AddOption(PrereleaseOption); + command.Arguments.Add(CmdPackageArgument); + command.Options.Add(VersionOption); + command.Options.Add(FrameworkOption); + command.Options.Add(NoRestoreOption); + command.Options.Add(SourceOption); + command.Options.Add(PackageDirOption); + command.Options.Add(InteractiveOption); + command.Options.Add(PrereleaseOption); command.SetHandler((parseResult) => new AddPackageReferenceCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs b/src/Cli/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs index 042a1b8b468a..29464c6f5134 100644 --- a/src/Cli/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs +++ b/src/Cli/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs @@ -37,9 +37,9 @@ private static Command ConstructCommand() { var command = new Command("reference", LocalizableStrings.AppFullName); - command.AddArgument(ProjectPathArgument); - command.AddOption(FrameworkOption); - command.AddOption(InteractiveOption); + command.Arguments.Add(ProjectPathArgument); + command.Options.Add(FrameworkOption); + command.Options.Add(InteractiveOption); command.SetHandler((parseResult) => new AddProjectToProjectReferenceCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs b/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs index f987cfb806fc..4f4d162db877 100644 --- a/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs @@ -57,25 +57,25 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("build", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(SlnOrProjectArgument); + command.Arguments.Add(SlnOrProjectArgument); RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: false, includeNoDependenciesOption: false); - command.AddOption(FrameworkOption); - command.AddOption(ConfigurationOption); - command.AddOption(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(CommonOptions.VersionSuffixOption); - command.AddOption(NoRestoreOption); - command.AddOption(CommonOptions.InteractiveMsBuildForwardOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.DebugOption); - command.AddOption(OutputOption); - command.AddOption(NoIncrementalOption); - command.AddOption(NoDependenciesOption); - command.AddOption(NoLogoOption); - command.AddOption(SelfContainedOption); - command.AddOption(NoSelfContainedOption); - command.AddOption(CommonOptions.ArchitectureOption); - command.AddOption(CommonOptions.OperatingSystemOption); - command.AddOption(CommonOptions.DisableBuildServersOption); + command.Options.Add(FrameworkOption); + command.Options.Add(ConfigurationOption); + command.Options.Add(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(CommonOptions.VersionSuffixOption); + command.Options.Add(NoRestoreOption); + command.Options.Add(CommonOptions.InteractiveMsBuildForwardOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.DebugOption); + command.Options.Add(OutputOption); + command.Options.Add(NoIncrementalOption); + command.Options.Add(NoDependenciesOption); + command.Options.Add(NoLogoOption); + command.Options.Add(SelfContainedOption); + command.Options.Add(NoSelfContainedOption); + command.Options.Add(CommonOptions.ArchitectureOption); + command.Options.Add(CommonOptions.OperatingSystemOption); + command.Options.Add(CommonOptions.DisableBuildServersOption); command.SetHandler(BuildCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs b/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs index 29bb4ffc395d..b3a3aad64cd3 100644 --- a/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs @@ -24,7 +24,7 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("build-server", DocsLink, LocalizableStrings.CommandDescription); - command.AddCommand(ServerShutdownCommandParser.GetCommand()); + command.Subcommands.Add(ServerShutdownCommandParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommandParser.cs b/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommandParser.cs index 96e4697eafe4..27f657491acd 100644 --- a/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommandParser.cs @@ -26,9 +26,9 @@ private static Command ConstructCommand() { var command = new Command("shutdown", LocalizableStrings.CommandDescription); - command.AddOption(MSBuildOption); - command.AddOption(VbcsOption); - command.AddOption(RazorOption); + command.Options.Add(MSBuildOption); + command.Options.Add(VbcsOption); + command.Options.Add(RazorOption); command.SetHandler((parseResult) => new BuildServerShutdownCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs b/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs index 81dc46e8f817..db3f50534ec0 100644 --- a/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs @@ -44,14 +44,14 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("clean", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(SlnOrProjectArgument); - command.AddOption(FrameworkOption); - command.AddOption(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(ConfigurationOption); - command.AddOption(CommonOptions.InteractiveMsBuildForwardOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(OutputOption); - command.AddOption(NoLogoOption); + command.Arguments.Add(SlnOrProjectArgument); + command.Options.Add(FrameworkOption); + command.Options.Add(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(ConfigurationOption); + command.Options.Add(CommonOptions.InteractiveMsBuildForwardOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(OutputOption); + command.Options.Add(NoLogoOption); command.SetHandler(CleanCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-complete/CompleteCommandParser.cs b/src/Cli/dotnet/commands/dotnet-complete/CompleteCommandParser.cs index 1a71cc1a17b7..90a16516c4e2 100644 --- a/src/Cli/dotnet/commands/dotnet-complete/CompleteCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-complete/CompleteCommandParser.cs @@ -30,8 +30,8 @@ private static Command ConstructCommand() IsHidden = true }; - command.AddArgument(PathArgument); - command.AddOption(PositionOption); + command.Arguments.Add(PathArgument); + command.Options.Add(PositionOption); command.SetHandler(CompleteCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-help/HelpCommandParser.cs b/src/Cli/dotnet/commands/dotnet-help/HelpCommandParser.cs index f9545af66d61..85726a9ba437 100644 --- a/src/Cli/dotnet/commands/dotnet-help/HelpCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-help/HelpCommandParser.cs @@ -29,7 +29,7 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("help", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(Argument); + command.Arguments.Add(Argument); command.SetHandler(HelpCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs b/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs index 811ab09890b0..bb2c5083fd79 100644 --- a/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs @@ -25,7 +25,7 @@ private static Command ConstructCommand() IsHidden = true }; - command.AddArgument(Argument); + command.Arguments.Add(Argument); command.SetHandler(InternalReportinstallsuccess.Run); diff --git a/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs index 3972058dba4b..b5a0f2b8d1c1 100644 --- a/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs @@ -31,9 +31,9 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("list", DocsLink, LocalizableStrings.NetListCommand); - command.AddArgument(SlnOrProjectArgument); - command.AddCommand(ListPackageReferencesCommandParser.GetCommand()); - command.AddCommand(ListProjectToProjectReferencesCommandParser.GetCommand()); + command.Arguments.Add(SlnOrProjectArgument); + command.Subcommands.Add(ListPackageReferencesCommandParser.GetCommand()); + command.Subcommands.Add(ListProjectToProjectReferencesCommandParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs index b79fbf9941df..75ee31dbf202 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs @@ -72,18 +72,18 @@ private static Command ConstructCommand() { var command = new Command("package", LocalizableStrings.AppFullName); - command.AddOption(VerbosityOption); - command.AddOption(OutdatedOption); - command.AddOption(DeprecatedOption); - command.AddOption(VulnerableOption); - command.AddOption(FrameworkOption); - command.AddOption(TransitiveOption); - command.AddOption(PrereleaseOption); - command.AddOption(HighestPatchOption); - command.AddOption(HighestMinorOption); - command.AddOption(ConfigOption); - command.AddOption(SourceOption); - command.AddOption(InteractiveOption); + command.Options.Add(VerbosityOption); + command.Options.Add(OutdatedOption); + command.Options.Add(DeprecatedOption); + command.Options.Add(VulnerableOption); + command.Options.Add(FrameworkOption); + command.Options.Add(TransitiveOption); + command.Options.Add(PrereleaseOption); + command.Options.Add(HighestPatchOption); + command.Options.Add(HighestMinorOption); + command.Options.Add(ConfigOption); + command.Options.Add(SourceOption); + command.Options.Add(InteractiveOption); command.SetHandler((parseResult) => new ListPackageReferencesCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-reference/ListProjectToProjectReferencesCommandParser.cs b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-reference/ListProjectToProjectReferencesCommandParser.cs index bfc7fcf2a6a5..3b77b5a0925f 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-reference/ListProjectToProjectReferencesCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-reference/ListProjectToProjectReferencesCommandParser.cs @@ -24,7 +24,7 @@ private static Command ConstructCommand() { var command = new Command("reference", LocalizableStrings.AppFullName); - command.AddArgument(Argument); + command.Arguments.Add(Argument); command.SetHandler((parseResult) => new ListProjectToProjectReferencesCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs b/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs index 44d69c2958a4..a44bd337f462 100644 --- a/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs @@ -26,15 +26,15 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("nuget", DocsLink); - command.AddOption(new Option("--version")); - command.AddOption(new Option(new string[] { "-v", "--verbosity" })); + command.Options.Add(new Option("--version")); + command.Options.Add(new Option(new string[] { "-v", "--verbosity" })); - command.AddCommand(GetDeleteCommand()); - command.AddCommand(GetLocalsCommand()); - command.AddCommand(GetPushCommand()); - command.AddCommand(GetVerifyCommand()); - command.AddCommand(GetTrustCommand()); - command.AddCommand(GetSignCommand()); + command.Subcommands.Add(GetDeleteCommand()); + command.Subcommands.Add(GetLocalsCommand()); + command.Subcommands.Add(GetPushCommand()); + command.Subcommands.Add(GetVerifyCommand()); + command.Subcommands.Add(GetTrustCommand()); + command.Subcommands.Add(GetSignCommand()); command.SetHandler(NuGetCommand.Run); @@ -44,13 +44,13 @@ private static Command ConstructCommand() private static Command GetDeleteCommand() { var deleteCommand = new Command("delete"); - deleteCommand.AddArgument(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); - deleteCommand.AddOption(new Option("--force-english-output")); - deleteCommand.AddOption(new Option(new string[] { "-s", "--source" })); - deleteCommand.AddOption(new Option("--non-interactive")); - deleteCommand.AddOption(new Option(new string[] { "-k", "--api-key" })); - deleteCommand.AddOption(new Option("--no-service-endpoint")); - deleteCommand.AddOption(new Option("--interactive")); + deleteCommand.Arguments.Add(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); + deleteCommand.Options.Add(new Option("--force-english-output")); + deleteCommand.Options.Add(new Option(new string[] { "-s", "--source" })); + deleteCommand.Options.Add(new Option("--non-interactive")); + deleteCommand.Options.Add(new Option(new string[] { "-k", "--api-key" })); + deleteCommand.Options.Add(new Option("--no-service-endpoint")); + deleteCommand.Options.Add(new Option("--interactive")); deleteCommand.SetHandler(NuGetCommand.Run); @@ -61,12 +61,14 @@ private static Command GetLocalsCommand() { var localsCommand = new Command("locals"); - localsCommand.AddArgument(new Argument("folders") - .AcceptOnlyFromAmong(new string[] { "all", "http-cache", "global-packages", "plugins-cache", "temp" })); + Argument foldersArgument = new Argument("folders"); + foldersArgument.AcceptOnlyFromAmong(new string[] { "all", "http-cache", "global-packages", "plugins-cache", "temp" }); - localsCommand.AddOption(new Option("--force-english-output")); - localsCommand.AddOption(new Option(new string[] { "-c", "--clear" })); - localsCommand.AddOption(new Option(new string[] { "-l", "--list" })); + localsCommand.Arguments.Add(foldersArgument); + + localsCommand.Options.Add(new Option("--force-english-output")); + localsCommand.Options.Add(new Option(new string[] { "-c", "--clear" })); + localsCommand.Options.Add(new Option(new string[] { "-l", "--list" })); localsCommand.SetHandler(NuGetCommand.Run); @@ -77,19 +79,19 @@ private static Command GetPushCommand() { var pushCommand = new Command("push"); - pushCommand.AddArgument(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); + pushCommand.Arguments.Add(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); - pushCommand.AddOption(new Option("--force-english-output")); - pushCommand.AddOption(new Option(new string[] { "-s", "--source" })); - pushCommand.AddOption(new Option(new string[] { "-ss", "--symbol-source" })); - pushCommand.AddOption(new Option(new string[] { "-t", "--timeout" })); - pushCommand.AddOption(new Option(new string[] { "-k", "--api-key" })); - pushCommand.AddOption(new Option(new string[] { "-sk", "--symbol-api-key" })); - pushCommand.AddOption(new Option(new string[] { "-d", "--disable-buffering" })); - pushCommand.AddOption(new Option(new string[] { "-n", "--no-symbols" })); - pushCommand.AddOption(new Option("--no-service-endpoint")); - pushCommand.AddOption(new Option("--interactive")); - pushCommand.AddOption(new Option("--skip-duplicate")); + pushCommand.Options.Add(new Option("--force-english-output")); + pushCommand.Options.Add(new Option(new string[] { "-s", "--source" })); + pushCommand.Options.Add(new Option(new string[] { "-ss", "--symbol-source" })); + pushCommand.Options.Add(new Option(new string[] { "-t", "--timeout" })); + pushCommand.Options.Add(new Option(new string[] { "-k", "--api-key" })); + pushCommand.Options.Add(new Option(new string[] { "-sk", "--symbol-api-key" })); + pushCommand.Options.Add(new Option(new string[] { "-d", "--disable-buffering" })); + pushCommand.Options.Add(new Option(new string[] { "-n", "--no-symbols" })); + pushCommand.Options.Add(new Option("--no-service-endpoint")); + pushCommand.Options.Add(new Option("--interactive")); + pushCommand.Options.Add(new Option("--skip-duplicate")); pushCommand.SetHandler(NuGetCommand.Run); @@ -101,13 +103,13 @@ private static Command GetVerifyCommand() const string fingerprint = "--certificate-fingerprint"; var verifyCommand = new Command("verify"); - verifyCommand.AddArgument(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); + verifyCommand.Arguments.Add(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); - verifyCommand.AddOption(new Option("--all")); - verifyCommand.AddOption(new ForwardedOption>(fingerprint) + verifyCommand.Options.Add(new Option("--all")); + verifyCommand.Options.Add(new ForwardedOption>(fingerprint) .ForwardAsManyArgumentsEachPrefixedByOption(fingerprint) .AllowSingleArgPerToken()); - verifyCommand.AddOption(CommonOptions.VerbosityOption); + verifyCommand.Options.Add(CommonOptions.VerbosityOption); verifyCommand.SetHandler(NuGetCommand.Run); @@ -118,14 +120,16 @@ private static Command GetTrustCommand() { var trustCommand = new Command("trust"); - trustCommand.AddArgument(new Argument("command") { Arity = ArgumentArity.ZeroOrOne } - .AcceptOnlyFromAmong(new string[] { "list", "author", "repository", "source", "certificate", "remove", "sync" })); + Argument commandArgument = new Argument("command") { Arity = ArgumentArity.ZeroOrOne }; + commandArgument.AcceptOnlyFromAmong(new string[] { "list", "author", "repository", "source", "certificate", "remove", "sync" }); + + trustCommand.Arguments.Add(commandArgument); - trustCommand.AddOption(new Option("--algorithm")); - trustCommand.AddOption(new Option("--allow-untrusted-root")); - trustCommand.AddOption(new Option("--owners")); - trustCommand.AddOption(new Option("--configfile")); - trustCommand.AddOption(CommonOptions.VerbosityOption); + trustCommand.Options.Add(new Option("--algorithm")); + trustCommand.Options.Add(new Option("--allow-untrusted-root")); + trustCommand.Options.Add(new Option("--owners")); + trustCommand.Options.Add(new Option("--configfile")); + trustCommand.Options.Add(CommonOptions.VerbosityOption); trustCommand.SetHandler(NuGetCommand.Run); @@ -136,20 +140,20 @@ private static Command GetSignCommand() { var signCommand = new Command("sign"); - signCommand.AddArgument(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); - - signCommand.AddOption(new Option(new string[] { "-o", "--output" })); - signCommand.AddOption(new Option("--certificate-path")); - signCommand.AddOption(new Option("--certificate-store-name")); - signCommand.AddOption(new Option("--certificate-store-location")); - signCommand.AddOption(new Option("--certificate-subject-name")); - signCommand.AddOption(new Option("--certificate-fingerprint")); - signCommand.AddOption(new Option("--certificate-password")); - signCommand.AddOption(new Option("--hash-algorithm")); - signCommand.AddOption(new Option("--timestamper")); - signCommand.AddOption(new Option("--timestamp-hash-algorithm")); - signCommand.AddOption(new Option("--overwrite")); - signCommand.AddOption(CommonOptions.VerbosityOption); + signCommand.Arguments.Add(new Argument>("package-paths") { Arity = ArgumentArity.OneOrMore }); + + signCommand.Options.Add(new Option(new string[] { "-o", "--output" })); + signCommand.Options.Add(new Option("--certificate-path")); + signCommand.Options.Add(new Option("--certificate-store-name")); + signCommand.Options.Add(new Option("--certificate-store-location")); + signCommand.Options.Add(new Option("--certificate-subject-name")); + signCommand.Options.Add(new Option("--certificate-fingerprint")); + signCommand.Options.Add(new Option("--certificate-password")); + signCommand.Options.Add(new Option("--hash-algorithm")); + signCommand.Options.Add(new Option("--timestamper")); + signCommand.Options.Add(new Option("--timestamp-hash-algorithm")); + signCommand.Options.Add(new Option("--overwrite")); + signCommand.Options.Add(CommonOptions.VerbosityOption); signCommand.SetHandler(NuGetCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs index 8108b3fb5f99..daf80f6a230b 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs @@ -56,18 +56,18 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("pack", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(SlnOrProjectArgument); - command.AddOption(OutputOption); - command.AddOption(NoBuildOption); - command.AddOption(IncludeSymbolsOption); - command.AddOption(IncludeSourceOption); - command.AddOption(ServiceableOption); - command.AddOption(NoLogoOption); - command.AddOption(CommonOptions.InteractiveMsBuildForwardOption); - command.AddOption(NoRestoreOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.VersionSuffixOption); - command.AddOption(ConfigurationOption); + command.Arguments.Add(SlnOrProjectArgument); + command.Options.Add(OutputOption); + command.Options.Add(NoBuildOption); + command.Options.Add(IncludeSymbolsOption); + command.Options.Add(IncludeSourceOption); + command.Options.Add(ServiceableOption); + command.Options.Add(NoLogoOption); + command.Options.Add(CommonOptions.InteractiveMsBuildForwardOption); + command.Options.Add(NoRestoreOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.VersionSuffixOption); + command.Options.Add(ConfigurationOption); RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: true, includeNoDependenciesOption: true); command.SetHandler(PackCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs index abf0bf9fa45d..e38b85bf27b9 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -62,24 +62,24 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("publish", DocsLink, LocalizableStrings.AppDescription); - command.AddArgument(SlnOrProjectArgument); + command.Arguments.Add(SlnOrProjectArgument); RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: false, includeNoDependenciesOption: true); - command.AddOption(OuputOption); - command.AddOption(ManifestOption); - command.AddOption(NoBuildOption); - command.AddOption(SelfContainedOption); - command.AddOption(NoSelfContainedOption); - command.AddOption(NoLogoOption); - command.AddOption(FrameworkOption); - command.AddOption(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(ConfigurationOption); - command.AddOption(CommonOptions.VersionSuffixOption); - command.AddOption(CommonOptions.InteractiveMsBuildForwardOption); - command.AddOption(NoRestoreOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.ArchitectureOption); - command.AddOption(CommonOptions.OperatingSystemOption); - command.AddOption(CommonOptions.DisableBuildServersOption); + command.Options.Add(OuputOption); + command.Options.Add(ManifestOption); + command.Options.Add(NoBuildOption); + command.Options.Add(SelfContainedOption); + command.Options.Add(NoSelfContainedOption); + command.Options.Add(NoLogoOption); + command.Options.Add(FrameworkOption); + command.Options.Add(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(ConfigurationOption); + command.Options.Add(CommonOptions.VersionSuffixOption); + command.Options.Add(CommonOptions.InteractiveMsBuildForwardOption); + command.Options.Add(NoRestoreOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.ArchitectureOption); + command.Options.Add(CommonOptions.OperatingSystemOption); + command.Options.Add(CommonOptions.DisableBuildServersOption); command.SetHandler(PublishCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs b/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs index 9e76bfa312b4..dd7cfebcf705 100644 --- a/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs @@ -30,9 +30,9 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("remove", DocsLink, LocalizableStrings.NetRemoveCommand); - command.AddArgument(ProjectArgument); - command.AddCommand(RemovePackageParser.GetCommand()); - command.AddCommand(RemoveProjectToProjectReferenceParser.GetCommand()); + command.Arguments.Add(ProjectArgument); + command.Subcommands.Add(RemovePackageParser.GetCommand()); + command.Subcommands.Add(RemoveProjectToProjectReferenceParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs b/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs index 5c27ddf253ff..9c54f77ce05d 100644 --- a/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs +++ b/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs @@ -33,8 +33,8 @@ private static Command ConstructCommand() { var command = new Command("package", LocalizableStrings.AppFullName); - command.AddArgument(CmdPackageArgument); - command.AddOption(InteractiveOption); + command.Arguments.Add(CmdPackageArgument); + command.Options.Add(InteractiveOption); command.SetHandler((parseResult) => new RemovePackageReferenceCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs b/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs index b691c1be882b..ad07ed58ae95 100644 --- a/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs +++ b/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs @@ -35,8 +35,8 @@ private static Command ConstructCommand() { var command = new Command("reference", LocalizableStrings.AppFullName); - command.AddArgument(ProjectPathArgument); - command.AddOption(FrameworkOption); + command.Arguments.Add(ProjectPathArgument); + command.Options.Add(FrameworkOption); command.SetHandler((parseResult) => new RemoveProjectToProjectReferenceCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index a29848fd0081..4468b3800ac3 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -66,12 +66,12 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("restore", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(SlnOrProjectArgument); - command.AddOption(CommonOptions.DisableBuildServersOption); + command.Arguments.Add(SlnOrProjectArgument); + command.Options.Add(CommonOptions.DisableBuildServersOption); foreach (var option in FullRestoreOptions()) { - command.AddOption(option); + command.Options.Add(option); } command.SetHandler(RestoreCommand.Run); @@ -83,7 +83,7 @@ public static void AddImplicitRestoreOptions(Command command, bool showHelp = fa { foreach (var option in ImplicitRestoreOptions(showHelp, useShortOptions, includeRuntimeOption, includeNoDependenciesOption)) { - command.AddOption(option); + command.Options.Add(option); } } diff --git a/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs b/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs index a8f51457f940..dc10f8f60832 100644 --- a/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs @@ -55,23 +55,23 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("run", DocsLink, LocalizableStrings.AppFullName); - command.AddOption(ConfigurationOption); - command.AddOption(FrameworkOption); - command.AddOption(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(ProjectOption); - command.AddOption(PropertyOption); - command.AddOption(LaunchProfileOption); - command.AddOption(NoLaunchProfileOption); - command.AddOption(NoBuildOption); - command.AddOption(InteractiveOption); - command.AddOption(NoRestoreOption); - command.AddOption(SelfContainedOption); - command.AddOption(NoSelfContainedOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.ArchitectureOption); - command.AddOption(CommonOptions.OperatingSystemOption); - - command.AddArgument(ApplicationArguments); + command.Options.Add(ConfigurationOption); + command.Options.Add(FrameworkOption); + command.Options.Add(RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(ProjectOption); + command.Options.Add(PropertyOption); + command.Options.Add(LaunchProfileOption); + command.Options.Add(NoLaunchProfileOption); + command.Options.Add(NoBuildOption); + command.Options.Add(InteractiveOption); + command.Options.Add(NoRestoreOption); + command.Options.Add(SelfContainedOption); + command.Options.Add(NoSelfContainedOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.ArchitectureOption); + command.Options.Add(CommonOptions.OperatingSystemOption); + + command.Arguments.Add(ApplicationArguments); command.SetHandler(RunCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs b/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs index 9d2ceddf6bfb..e01389141da4 100644 --- a/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs @@ -24,7 +24,7 @@ public static Command GetCommand() private static Command ConstructCommand() { var command = new DocumentedCommand("sdk", DocsLink, LocalizableStrings.AppFullName); - command.AddCommand(SdkCheckCommandParser.GetCommand()); + command.Subcommands.Add(SdkCheckCommandParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs b/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs index db9e13b2ae21..b80cbb433bb3 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs @@ -30,10 +30,10 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("sln", DocsLink, LocalizableStrings.AppFullName); - command.AddArgument(SlnArgument); - command.AddCommand(SlnAddParser.GetCommand()); - command.AddCommand(SlnListParser.GetCommand()); - command.AddCommand(SlnRemoveParser.GetCommand()); + command.Arguments.Add(SlnArgument); + command.Subcommands.Add(SlnAddParser.GetCommand()); + command.Subcommands.Add(SlnListParser.GetCommand()); + command.Subcommands.Add(SlnRemoveParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-sln/add/SlnAddParser.cs b/src/Cli/dotnet/commands/dotnet-sln/add/SlnAddParser.cs index 3faa9fc0fcb5..96707586e71c 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/add/SlnAddParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/add/SlnAddParser.cs @@ -33,9 +33,9 @@ private static Command ConstructCommand() { var command = new Command("add", LocalizableStrings.AddAppFullName); - command.AddArgument(ProjectPathArgument); - command.AddOption(InRootOption); - command.AddOption(SolutionFolderOption); + command.Arguments.Add(ProjectPathArgument); + command.Options.Add(InRootOption); + command.Options.Add(SolutionFolderOption); command.SetHandler((parseResult) => new AddProjectToSolutionCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-sln/remove/SlnRemoveParser.cs b/src/Cli/dotnet/commands/dotnet-sln/remove/SlnRemoveParser.cs index 31143683553e..fcfa07ddab4d 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/remove/SlnRemoveParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/remove/SlnRemoveParser.cs @@ -29,7 +29,7 @@ private static Command ConstructCommand() { var command = new Command("remove", LocalizableStrings.RemoveAppFullName); - command.AddArgument(ProjectPathArgument); + command.Arguments.Add(ProjectPathArgument); command.SetHandler((parseResult) => new RemoveProjectFromSolutionCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs index 4ef2015a6884..d56176ff1e81 100644 --- a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -78,17 +78,17 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("store", DocsLink, LocalizableStrings.AppDescription); - command.AddArgument(Argument); - command.AddOption(ManifestOption); - command.AddOption(FrameworkVersionOption); - command.AddOption(OutputOption); - command.AddOption(WorkingDirOption); - command.AddOption(SkipOptimizationOption); - command.AddOption(SkipSymbolsOption); - command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); - command.AddOption(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.CurrentRuntimeOption(LocalizableStrings.CurrentRuntimeOptionDescription)); + command.Arguments.Add(Argument); + command.Options.Add(ManifestOption); + command.Options.Add(FrameworkVersionOption); + command.Options.Add(OutputOption); + command.Options.Add(WorkingDirOption); + command.Options.Add(SkipOptimizationOption); + command.Options.Add(SkipSymbolsOption); + command.Options.Add(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); + command.Options.Add(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.CurrentRuntimeOption(LocalizableStrings.CurrentRuntimeOptionDescription)); command.SetHandler(StoreCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs index ed2f062604c3..4072faf302dd 100644 --- a/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -89,12 +89,18 @@ internal static class TestCommandParser public static readonly Option BlameCrashOption = new ForwardedOption("--blame-crash", LocalizableStrings.CmdBlameCrashDescription) .ForwardAs("-property:VSTestBlameCrash=true"); - public static readonly Option BlameCrashDumpOption = new ForwardedOption("--blame-crash-dump-type", LocalizableStrings.CmdBlameCrashDumpTypeDescription) + public static readonly Option BlameCrashDumpOption = CreateBlameCrashDumpOption(); + + private static Option CreateBlameCrashDumpOption() { - ArgumentHelpName = LocalizableStrings.CrashDumpTypeArgumentName, + Option result = new ForwardedOption("--blame-crash-dump-type", LocalizableStrings.CmdBlameCrashDumpTypeDescription) + { + ArgumentHelpName = LocalizableStrings.CrashDumpTypeArgumentName, + } + .ForwardAsMany(o => new[] { "-property:VSTestBlameCrash=true", $"-property:VSTestBlameCrashDumpType={o}" }); + result.AcceptOnlyFromAmong(new string[] { "full", "mini" }); + return result; } - .ForwardAsMany(o => new[] { "-property:VSTestBlameCrash=true", $"-property:VSTestBlameCrashDumpType={o}" }) - .AcceptOnlyFromAmong(new string[] { "full", "mini" }); public static readonly Option BlameCrashAlwaysOption = new ForwardedOption("--blame-crash-collect-always", LocalizableStrings.CmdBlameCrashCollectAlwaysDescription) .ForwardAsMany(o => new[] { "-property:VSTestBlameCrash=true", "-property:VSTestBlameCrashCollectAlways=true" }); @@ -102,12 +108,18 @@ internal static class TestCommandParser public static readonly Option BlameHangOption = new ForwardedOption("--blame-hang", LocalizableStrings.CmdBlameHangDescription) .ForwardAs("-property:VSTestBlameHang=true"); - public static readonly Option BlameHangDumpOption = new ForwardedOption("--blame-hang-dump-type", LocalizableStrings.CmdBlameHangDumpTypeDescription) + public static readonly Option BlameHangDumpOption = CreateBlameHangDumpOption(); + + private static Option CreateBlameHangDumpOption() { - ArgumentHelpName = LocalizableStrings.HangDumpTypeArgumentName + Option result = new ForwardedOption("--blame-hang-dump-type", LocalizableStrings.CmdBlameHangDumpTypeDescription) + { + ArgumentHelpName = LocalizableStrings.HangDumpTypeArgumentName + } + .ForwardAsMany(o => new[] { "-property:VSTestBlameHang=true", $"-property:VSTestBlameHangDumpType={o}" }); + result.AcceptOnlyFromAmong(new string[] { "full", "mini", "none" }); + return result; } - .ForwardAsMany(o => new[] { "-property:VSTestBlameHang=true", $"-property:VSTestBlameHangDumpType={o}" }) - .AcceptOnlyFromAmong(new string[] { "full", "mini", "none" }); public static readonly Option BlameHangTimeoutOption = new ForwardedOption("--blame-hang-timeout", LocalizableStrings.CmdBlameHangTimeoutDescription) { @@ -134,35 +146,35 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("test", DocsLink, LocalizableStrings.AppFullName); command.TreatUnmatchedTokensAsErrors = false; - command.AddArgument(SlnOrProjectArgument); - - command.AddOption(SettingsOption); - command.AddOption(ListTestsOption); - command.AddOption(EnvOption); - command.AddOption(FilterOption); - command.AddOption(AdapterOption); - command.AddOption(LoggerOption); - command.AddOption(OutputOption); - command.AddOption(DiagOption); - command.AddOption(NoBuildOption); - command.AddOption(ResultsOption); - command.AddOption(CollectOption); - command.AddOption(BlameOption); - command.AddOption(BlameCrashOption); - command.AddOption(BlameCrashDumpOption); - command.AddOption(BlameCrashAlwaysOption); - command.AddOption(BlameHangOption); - command.AddOption(BlameHangDumpOption); - command.AddOption(BlameHangTimeoutOption); - command.AddOption(NoLogoOption); - command.AddOption(ConfigurationOption); - command.AddOption(FrameworkOption); - command.AddOption(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); - command.AddOption(NoRestoreOption); - command.AddOption(CommonOptions.InteractiveMsBuildForwardOption); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(CommonOptions.ArchitectureOption); - command.AddOption(CommonOptions.OperatingSystemOption); + command.Arguments.Add(SlnOrProjectArgument); + + command.Options.Add(SettingsOption); + command.Options.Add(ListTestsOption); + command.Options.Add(EnvOption); + command.Options.Add(FilterOption); + command.Options.Add(AdapterOption); + command.Options.Add(LoggerOption); + command.Options.Add(OutputOption); + command.Options.Add(DiagOption); + command.Options.Add(NoBuildOption); + command.Options.Add(ResultsOption); + command.Options.Add(CollectOption); + command.Options.Add(BlameOption); + command.Options.Add(BlameCrashOption); + command.Options.Add(BlameCrashDumpOption); + command.Options.Add(BlameCrashAlwaysOption); + command.Options.Add(BlameHangOption); + command.Options.Add(BlameHangDumpOption); + command.Options.Add(BlameHangTimeoutOption); + command.Options.Add(NoLogoOption); + command.Options.Add(ConfigurationOption); + command.Options.Add(FrameworkOption); + command.Options.Add(CommonOptions.RuntimeOption.WithHelpDescription(command, LocalizableStrings.RuntimeOptionDescription)); + command.Options.Add(NoRestoreOption); + command.Options.Add(CommonOptions.InteractiveMsBuildForwardOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(CommonOptions.ArchitectureOption); + command.Options.Add(CommonOptions.OperatingSystemOption); command.SetHandler(TestCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs index c5a40f1406f6..fdb75b689641 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs @@ -24,13 +24,13 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("tool", DocsLink, LocalizableStrings.CommandDescription); - command.AddCommand(ToolInstallCommandParser.GetCommand()); - command.AddCommand(ToolUninstallCommandParser.GetCommand()); - command.AddCommand(ToolUpdateCommandParser.GetCommand()); - command.AddCommand(ToolListCommandParser.GetCommand()); - command.AddCommand(ToolRunCommandParser.GetCommand()); - command.AddCommand(ToolSearchCommandParser.GetCommand()); - command.AddCommand(ToolRestoreCommandParser.GetCommand()); + command.Subcommands.Add(ToolInstallCommandParser.GetCommand()); + command.Subcommands.Add(ToolUninstallCommandParser.GetCommand()); + command.Subcommands.Add(ToolUpdateCommandParser.GetCommand()); + command.Subcommands.Add(ToolListCommandParser.GetCommand()); + command.Subcommands.Add(ToolRunCommandParser.GetCommand()); + command.Subcommands.Add(ToolSearchCommandParser.GetCommand()); + command.Subcommands.Add(ToolRestoreCommandParser.GetCommand()); command.SetHandler((parseResult) => parseResult.HandleMissingCommand()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs index 16d68cccd0f9..f3beb8e5d510 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs @@ -64,22 +64,22 @@ private static Command ConstructCommand() { var command = new Command("install", LocalizableStrings.CommandDescription); - command.AddArgument(PackageIdArgument); - command.AddOption(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); - command.AddOption(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); - command.AddOption(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); - command.AddOption(VersionOption); - command.AddOption(ConfigOption); - command.AddOption(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); - command.AddOption(AddSourceOption); - command.AddOption(FrameworkOption); - command.AddOption(PrereleaseOption); - command.AddOption(ToolCommandRestorePassThroughOptions.DisableParallelOption); - command.AddOption(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); - command.AddOption(ToolCommandRestorePassThroughOptions.NoCacheOption); - command.AddOption(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); - command.AddOption(VerbosityOption); - command.AddOption(ArchitectureOption); + command.Arguments.Add(PackageIdArgument); + command.Options.Add(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); + command.Options.Add(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); + command.Options.Add(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); + command.Options.Add(VersionOption); + command.Options.Add(ConfigOption); + command.Options.Add(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); + command.Options.Add(AddSourceOption); + command.Options.Add(FrameworkOption); + command.Options.Add(PrereleaseOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.DisableParallelOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.NoCacheOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); + command.Options.Add(VerbosityOption); + command.Options.Add(ArchitectureOption); command.SetHandler((parseResult) => new ToolInstallCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs index df1f7c69aff1..8e235f078ccd 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs @@ -36,10 +36,10 @@ private static Command ConstructCommand() { var command = new Command("list", LocalizableStrings.CommandDescription); - command.AddArgument(PackageIdArgument); - command.AddOption(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); - command.AddOption(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); - command.AddOption(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); + command.Arguments.Add(PackageIdArgument); + command.Options.Add(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); + command.Options.Add(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); + command.Options.Add(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); command.SetHandler((parseResult) => new ToolListCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs index 4c06d0c3e78b..a8ed37317910 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs @@ -31,14 +31,14 @@ private static Command ConstructCommand() { var command = new Command("restore", LocalizableStrings.CommandDescription); - command.AddOption(ConfigOption); - command.AddOption(AddSourceOption); - command.AddOption(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); - command.AddOption(ToolCommandRestorePassThroughOptions.DisableParallelOption); - command.AddOption(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); - command.AddOption(ToolCommandRestorePassThroughOptions.NoCacheOption); - command.AddOption(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); - command.AddOption(VerbosityOption); + command.Options.Add(ConfigOption); + command.Options.Add(AddSourceOption); + command.Options.Add(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); + command.Options.Add(ToolCommandRestorePassThroughOptions.DisableParallelOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.NoCacheOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); + command.Options.Add(VerbosityOption); command.SetHandler((parseResult) => new ToolRestoreCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/run/ToolRunCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/run/ToolRunCommandParser.cs index 036d8cbf62f4..6a216070a348 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/run/ToolRunCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/run/ToolRunCommandParser.cs @@ -28,8 +28,8 @@ private static Command ConstructCommand() { var command = new Command("run", LocalizableStrings.CommandDescription); - command.AddArgument(CommandNameArgument); - command.AddArgument(CommandArgument); + command.Arguments.Add(CommandNameArgument); + command.Arguments.Add(CommandArgument); command.SetHandler((parseResult) => new ToolRunCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/search/ToolSearchCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/search/ToolSearchCommandParser.cs index 0a29febfe10e..438839b69898 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/search/ToolSearchCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/search/ToolSearchCommandParser.cs @@ -41,12 +41,12 @@ private static Command ConstructCommand() { var command = new Command("search", LocalizableStrings.CommandDescription); - command.AddArgument(SearchTermArgument); + command.Arguments.Add(SearchTermArgument); - command.AddOption(DetailOption); - command.AddOption(SkipOption); - command.AddOption(TakeOption); - command.AddOption(PrereleaseOption); + command.Options.Add(DetailOption); + command.Options.Add(SkipOption); + command.Options.Add(TakeOption); + command.Options.Add(PrereleaseOption); command.SetHandler((parseResult) => new ToolSearchCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs index 7d3b66a01f0c..3e7ff5bffde4 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs @@ -34,11 +34,11 @@ private static Command ConstructCommand() { var command = new Command("uninstall", LocalizableStrings.CommandDescription); - command.AddArgument(PackageIdArgument); - command.AddOption(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); - command.AddOption(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); - command.AddOption(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); - command.AddOption(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); + command.Arguments.Add(PackageIdArgument); + command.Options.Add(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); + command.Options.Add(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); + command.Options.Add(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); + command.Options.Add(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); command.SetHandler((parseResult) => new ToolUninstallCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommandParser.cs index e02e52bbcc78..b0216cd82fb6 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommandParser.cs @@ -45,21 +45,21 @@ private static Command ConstructCommand() { var command = new Command("update", LocalizableStrings.CommandDescription); - command.AddArgument(PackageIdArgument); - command.AddOption(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); - command.AddOption(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); - command.AddOption(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); - command.AddOption(ConfigOption); - command.AddOption(AddSourceOption); - command.AddOption(FrameworkOption); - command.AddOption(VersionOption); - command.AddOption(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); - command.AddOption(PrereleaseOption); - command.AddOption(ToolCommandRestorePassThroughOptions.DisableParallelOption); - command.AddOption(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); - command.AddOption(ToolCommandRestorePassThroughOptions.NoCacheOption); - command.AddOption(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); - command.AddOption(VerbosityOption); + command.Arguments.Add(PackageIdArgument); + command.Options.Add(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription)); + command.Options.Add(ToolPathOption.WithHelpDescription(command, LocalizableStrings.ToolPathOptionDescription)); + command.Options.Add(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription)); + command.Options.Add(ConfigOption); + command.Options.Add(AddSourceOption); + command.Options.Add(FrameworkOption); + command.Options.Add(VersionOption); + command.Options.Add(ToolManifestOption.WithHelpDescription(command, LocalizableStrings.ManifestPathOptionDescription)); + command.Options.Add(PrereleaseOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.DisableParallelOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.NoCacheOption); + command.Options.Add(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption); + command.Options.Add(VerbosityOption); command.SetHandler((parseResult) => new ToolUpdateCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-vstest/VSTestCommandParser.cs b/src/Cli/dotnet/commands/dotnet-vstest/VSTestCommandParser.cs index 42fe10a2ffcd..0ab08296fad4 100644 --- a/src/Cli/dotnet/commands/dotnet-vstest/VSTestCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-vstest/VSTestCommandParser.cs @@ -23,9 +23,9 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("vstest", DocsLink); - command.AddOption(CommonOptions.TestPlatformOption); - command.AddOption(CommonOptions.TestFrameworkOption); - command.AddOption(CommonOptions.TestLoggerOption); + command.Options.Add(CommonOptions.TestPlatformOption); + command.Options.Add(CommonOptions.TestFrameworkOption); + command.Options.Add(CommonOptions.TestLoggerOption); command.SetHandler(VSTestCommand.Run); diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs index ff48491ced54..7faa253c1633 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs @@ -54,10 +54,10 @@ public static RestoreActionConfig ToRestoreActionConfig(this ParseResult parseRe public static void AddWorkloadCommandNuGetRestoreActionConfigOptions(this Command command, bool Hide = false) { - command.AddOption(Hide ? HiddenDisableParallelOption : DisableParallelOption); - command.AddOption(Hide ? HiddenIgnoreFailedSourcesOption : IgnoreFailedSourcesOption); - command.AddOption(Hide ? HiddenNoCacheOption : NoCacheOption); - command.AddOption(Hide ? HiddenInteractiveRestoreOption : InteractiveRestoreOption); + command.Options.Add(Hide ? HiddenDisableParallelOption : DisableParallelOption); + command.Options.Add(Hide ? HiddenIgnoreFailedSourcesOption : IgnoreFailedSourcesOption); + command.Options.Add(Hide ? HiddenNoCacheOption : NoCacheOption); + command.Options.Add(Hide ? HiddenInteractiveRestoreOption : InteractiveRestoreOption); } } } diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs index aea59e789d2b..c4a1aec763b4 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs @@ -24,7 +24,7 @@ internal static class WorkloadCommandParser public static Command GetCommand() { - Command.AddOption(InfoOption); + Command.Options.Add(InfoOption); return Command; } @@ -85,14 +85,14 @@ private static Command ConstructCommand() { var command = new DocumentedCommand("workload", DocsLink, CommonStrings.CommandDescription); - command.AddCommand(WorkloadInstallCommandParser.GetCommand()); - command.AddCommand(WorkloadUpdateCommandParser.GetCommand()); - command.AddCommand(WorkloadListCommandParser.GetCommand()); - command.AddCommand(WorkloadSearchCommandParser.GetCommand()); - command.AddCommand(WorkloadUninstallCommandParser.GetCommand()); - command.AddCommand(WorkloadRepairCommandParser.GetCommand()); - command.AddCommand(WorkloadRestoreCommandParser.GetCommand()); - command.AddCommand(WorkloadElevateCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadInstallCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadUpdateCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadListCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadSearchCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadUninstallCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadRepairCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadRestoreCommandParser.GetCommand()); + command.Subcommands.Add(WorkloadElevateCommandParser.GetCommand()); command.SetHandler((parseResult) => ProcessArgs(parseResult)); diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommandParser.cs index f33a140d384c..1b1c6389249d 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommandParser.cs @@ -42,7 +42,7 @@ private static Command ConstructCommand() { var command = new Command("install", LocalizableStrings.CommandDescription); - command.AddArgument(WorkloadIdArgument); + command.Arguments.Add(WorkloadIdArgument); AddWorkloadInstallCommandOptions(command); command.SetHandler((parseResult) => new WorkloadInstallCommand(parseResult).Execute()); @@ -54,11 +54,11 @@ internal static void AddWorkloadInstallCommandOptions(Command command) { InstallingWorkloadCommandParser.AddWorkloadInstallCommandOptions(command); - command.AddOption(SkipManifestUpdateOption); - command.AddOption(TempDirOption); + command.Options.Add(SkipManifestUpdateOption); + command.Options.Add(TempDirOption); command.AddWorkloadCommandNuGetRestoreActionConfigOptions(); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(SkipSignCheckOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(SkipSignCheckOption); } } } diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs index 11be17fb7365..82e981fa1571 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs @@ -33,11 +33,11 @@ public static Command GetCommand() private static Command ConstructCommand() { var command = new Command("list", LocalizableStrings.CommandDescription); - command.AddOption(MachineReadableOption); - command.AddOption(CommonOptions.HiddenVerbosityOption); - command.AddOption(VersionOption); - command.AddOption(TempDirOption); - command.AddOption(IncludePreviewsOption); + command.Options.Add(MachineReadableOption); + command.Options.Add(CommonOptions.HiddenVerbosityOption); + command.Options.Add(VersionOption); + command.Options.Add(TempDirOption); + command.Options.Add(IncludePreviewsOption); command.AddWorkloadCommandNuGetRestoreActionConfigOptions(true); command.SetHandler((parseResult) => new WorkloadListCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-workload/repair/WorkloadRepairCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/repair/WorkloadRepairCommandParser.cs index 41b3618f61cc..afeea33f8c6d 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/repair/WorkloadRepairCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/repair/WorkloadRepairCommandParser.cs @@ -29,12 +29,12 @@ private static Command ConstructCommand() { var command = new Command("repair", LocalizableStrings.CommandDescription); - command.AddOption(VersionOption); - command.AddOption(ConfigOption); - command.AddOption(SourceOption); - command.AddOption(CommonOptions.VerbosityOption); + command.Options.Add(VersionOption); + command.Options.Add(ConfigOption); + command.Options.Add(SourceOption); + command.Options.Add(CommonOptions.VerbosityOption); command.AddWorkloadCommandNuGetRestoreActionConfigOptions(); - command.AddOption(WorkloadInstallCommandParser.SkipSignCheckOption); + command.Options.Add(WorkloadInstallCommandParser.SkipSignCheckOption); command.SetHandler((parseResult) => new WorkloadRepairCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommandParser.cs index fb7a89145cc2..03b73f32dd34 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommandParser.cs @@ -22,7 +22,7 @@ private static Command ConstructCommand() { Command command = new Command("restore", LocalizableStrings.CommandDescription); - command.AddArgument(RestoreCommandParser.SlnOrProjectArgument); + command.Arguments.Add(RestoreCommandParser.SlnOrProjectArgument); WorkloadInstallCommandParser.AddWorkloadInstallCommandOptions(command); command.SetHandler((parseResult) => new WorkloadRestoreCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchCommandParser.cs index aca4754fbee6..5da77c053d70 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchCommandParser.cs @@ -31,9 +31,9 @@ public static Command GetCommand() private static Command ConstructCommand() { var command = new Command("search", LocalizableStrings.CommandDescription); - command.AddArgument(WorkloadIdStubArgument); - command.AddOption(CommonOptions.HiddenVerbosityOption); - command.AddOption(VersionOption); + command.Arguments.Add(WorkloadIdStubArgument); + command.Options.Add(CommonOptions.HiddenVerbosityOption); + command.Options.Add(VersionOption); command.SetHandler((parseResult) => new WorkloadSearchCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-workload/uninstall/WorkloadUninstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/uninstall/WorkloadUninstallCommandParser.cs index 00d28b8e7f7d..613e9d5f0386 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/uninstall/WorkloadUninstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/uninstall/WorkloadUninstallCommandParser.cs @@ -27,8 +27,8 @@ public static Command GetCommand() private static Command ConstructCommand() { Command command = new Command("uninstall", LocalizableStrings.CommandDescription); - command.AddArgument(WorkloadIdArgument); - command.AddOption(WorkloadInstallCommandParser.SkipSignCheckOption); + command.Arguments.Add(WorkloadIdArgument); + command.Options.Add(WorkloadInstallCommandParser.SkipSignCheckOption); command.SetHandler((parseResult) => new WorkloadUninstallCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-workload/update/WorkloadUpdateCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/update/WorkloadUpdateCommandParser.cs index 704430f31cdd..75275a1e3708 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/update/WorkloadUpdateCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/update/WorkloadUpdateCommandParser.cs @@ -36,13 +36,13 @@ private static Command ConstructCommand() InstallingWorkloadCommandParser.AddWorkloadInstallCommandOptions(command); - command.AddOption(TempDirOption); - command.AddOption(FromPreviousSdkOption); - command.AddOption(AdManifestOnlyOption); + command.Options.Add(TempDirOption); + command.Options.Add(FromPreviousSdkOption); + command.Options.Add(AdManifestOnlyOption); command.AddWorkloadCommandNuGetRestoreActionConfigOptions(); - command.AddOption(CommonOptions.VerbosityOption); - command.AddOption(PrintRollbackOption); - command.AddOption(WorkloadInstallCommandParser.SkipSignCheckOption); + command.Options.Add(CommonOptions.VerbosityOption); + command.Options.Add(PrintRollbackOption); + command.Options.Add(WorkloadInstallCommandParser.SkipSignCheckOption); command.SetHandler((parseResult) => new WorkloadUpdateCommand(parseResult).Execute()); diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstantiateTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstantiateTests.cs index a870832c723c..abbe13c791df 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstantiateTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstantiateTests.cs @@ -255,7 +255,7 @@ internal void CanParseNameOption(string command, string? expectedValue) RootCommand rootCommand = new(); NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", _ => host); - rootCommand.AddCommand(myCommand); + rootCommand.Subcommands.Add(myCommand); ParseResult parseResult = rootCommand.Parse(command); InstantiateCommandArgs args = InstantiateCommandArgs.FromNewCommandArgs(new NewCommandArgs(myCommand, parseResult)); TemplateCommand templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single()); @@ -749,7 +749,7 @@ internal void CanParseFlagsOption(string command, string action) RootCommand rootCommand = new(); NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", _ => host); - rootCommand.AddCommand(myCommand); + rootCommand.Subcommands.Add(myCommand); ParseResult parseResult = rootCommand.Parse(command); InstantiateCommandArgs args = InstantiateCommandArgs.FromNewCommandArgs(new NewCommandArgs(myCommand, parseResult)); TemplateCommand templateCommand = new( diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/TabularOutputTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/TabularOutputTests.cs index 9d9b8cc9c646..c7689e0addcf 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/TabularOutputTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/TabularOutputTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. // +using System.CommandLine.Completions; using System.Reflection; using Microsoft.TemplateEngine.Cli.Commands; using Microsoft.TemplateEngine.Cli.TabularOutput; @@ -287,7 +288,7 @@ public void VerifyColumnsOptionHasAllColumnNamesDefined() var columnOption = SharedOptionsFactory.CreateColumnsOption(); //Gets suggestions defined in column options - List suggestedValues = columnOption.GetCompletions().Select(c => c.Label).ToList(); + List suggestedValues = columnOption.GetCompletions(CompletionContext.Empty).Select(c => c.Label).ToList(); suggestedValues.Sort(); //Gets constants defined in TabularOutputSettings.ColumnNams From bb036ddc80aee23fd27b7fa9596f24da4aa61d42 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 20 Jan 2023 12:23:14 +0100 Subject: [PATCH 06/82] adopt to recent breaking changes: removal of Children property * OptionResult.Tokens returns Tokens of all its children * only CommandResult defines Children property * don't search for ParseError more than once --- .../Commands/Extensions.cs | 22 ++++++---------- .../create/InvalidTemplateOptionResult.cs | 25 ++----------------- .../Commands/create/TemplateResult.cs | 10 ++++---- src/Cli/dotnet/ParseResultExtensions.cs | 2 +- .../AllowListToSendFirstAppliedOptions.cs | 4 +-- 5 files changed, 17 insertions(+), 46 deletions(-) diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs index a1587e4706fc..05f554d7125e 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/Extensions.cs @@ -4,6 +4,7 @@ using System.CommandLine; using System.CommandLine.Parsing; +using System.Diagnostics.CodeAnalysis; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.Constraints; using Microsoft.TemplateEngine.Edge; @@ -25,24 +26,15 @@ internal static class Extensions /// /// Checks if contains an error for . /// - internal static bool HasErrorFor(this ParseResult parseResult, Option option) + internal static bool HasErrorFor(this ParseResult parseResult, Option option, [NotNullWhen(true)] out ParseError? error) { - if (!parseResult.Errors.Any()) - { - return false; - } + error = parseResult.Errors.FirstOrDefault(e => IsOptionResult(e.SymbolResult, option) + || IsOptionResult(e.SymbolResult?.Parent, option)); - if (parseResult.Errors.Any(e => e.SymbolResult?.Symbol == option)) - { - return true; - } - - if (parseResult.Errors.Any(e => e.SymbolResult?.Parent?.Symbol == option)) - { - return true; - } + return error is not null; - return false; + static bool IsOptionResult(SymbolResult? symbolResult, Option option) + => symbolResult is OptionResult optionResult && optionResult.Option == option; } /// diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InvalidTemplateOptionResult.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InvalidTemplateOptionResult.cs index 790f08949a3a..5d9b1910c9e1 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InvalidTemplateOptionResult.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InvalidTemplateOptionResult.cs @@ -83,13 +83,8 @@ public bool Equals(InvalidTemplateOptionResult? other) return this.Equals(other as object); } - internal static new InvalidTemplateOptionResult FromParseResult(TemplateOption option, ParseResult parseResult) + internal static InvalidTemplateOptionResult FromParseError(TemplateOption option, ParseResult parseResult, ParseError error) { - if (!parseResult.HasErrorFor(option.Option)) - { - throw new ArgumentException($"{nameof(option)} does not have an error in {nameof(parseResult)}"); - } - OptionResult? optionResult = parseResult.FindResultFor(option.Option); if (optionResult == null) { @@ -103,23 +98,7 @@ public bool Equals(InvalidTemplateOptionResult? other) optionValue = string.Join(", ", optionResult.Tokens.Select(t => t.Value)); } - string? errorMessage = null; - if (!string.IsNullOrWhiteSpace(optionResult.ErrorMessage)) - { - errorMessage = optionResult.ErrorMessage; - } - else - { - foreach (var result in optionResult.Children) - { - if (string.IsNullOrWhiteSpace(result.ErrorMessage)) - { - continue; - } - errorMessage = result.ErrorMessage; - break; - } - } + string errorMessage = !string.IsNullOrWhiteSpace(optionResult.ErrorMessage) ? optionResult.ErrorMessage : error.Message; return new InvalidTemplateOptionResult( option, diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateResult.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateResult.cs index ec8e614daebe..dbb7d0333a6e 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateResult.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/TemplateResult.cs @@ -41,9 +41,9 @@ private TemplateResult(TemplateCommand templateCommand, ParseResult parseResult) internal static TemplateResult FromParseResult(TemplateCommand templateCommand, ParseResult parseResult) { TemplateResult result = new TemplateResult(templateCommand, parseResult); - result.IsLanguageMatch = templateCommand.LanguageOption == null || !parseResult.HasErrorFor(templateCommand.LanguageOption); - result.IsTypeMatch = templateCommand.TypeOption == null || !parseResult.HasErrorFor(templateCommand.TypeOption); - result.IsBaselineMatch = templateCommand.BaselineOption == null || !parseResult.HasErrorFor(templateCommand.BaselineOption); + result.IsLanguageMatch = templateCommand.LanguageOption == null || !parseResult.HasErrorFor(templateCommand.LanguageOption, out _); + result.IsTypeMatch = templateCommand.TypeOption == null || !parseResult.HasErrorFor(templateCommand.TypeOption, out _); + result.IsBaselineMatch = templateCommand.BaselineOption == null || !parseResult.HasErrorFor(templateCommand.BaselineOption, out _); if (templateCommand.LanguageOption != null && result.IsTemplateMatch) { @@ -52,9 +52,9 @@ internal static TemplateResult FromParseResult(TemplateCommand templateCommand, foreach (var option in templateCommand.TemplateOptions) { - if (parseResult.HasErrorFor(option.Value.Option)) + if (parseResult.HasErrorFor(option.Value.Option, out var parseError)) { - result._parametersInfo.Add(InvalidTemplateOptionResult.FromParseResult(option.Value, parseResult)); + result._parametersInfo.Add(InvalidTemplateOptionResult.FromParseError(option.Value, parseResult, parseError)); } else { diff --git a/src/Cli/dotnet/ParseResultExtensions.cs b/src/Cli/dotnet/ParseResultExtensions.cs index 733daf90b758..9e5845e2dbb3 100644 --- a/src/Cli/dotnet/ParseResultExtensions.cs +++ b/src/Cli/dotnet/ParseResultExtensions.cs @@ -181,7 +181,7 @@ private static IEnumerable GetRunPropertyOptions(ParseResult parseResult var optionString = shorthand ? "-p" : "--property"; var options = parseResult.CommandResult.Children.Where(c => c.Token().Type.Equals(TokenType.Option)); var propertyOptions = options.Where(o => o.Token().Value.Equals(optionString)); - var propertyValues = propertyOptions.SelectMany(o => o.Children.SelectMany(c => c.Tokens.Select(t=> t.Value))).ToArray(); + var propertyValues = propertyOptions.SelectMany(o => o.Tokens.Select(t=> t.Value)).ToArray(); return propertyValues; } diff --git a/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs b/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs index 8512ff37acc4..adcb39ad8a13 100644 --- a/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs +++ b/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs @@ -26,8 +26,8 @@ public List AllowList(ParseResult parseResult, D if (_topLevelCommandNameAllowList.Contains(topLevelCommandNameFromParse)) { var firstOption = parseResult.RootCommandResult.Children - .FirstOrDefault(c => c.Token() != default && c.Token().Type.Equals(TokenType.Command))? - .Children.FirstOrDefault(c => c is System.CommandLine.Parsing.CommandResult)?.Symbol.Name ?? null; + .OfType().FirstOrDefault()? + .Children.OfType().FirstOrDefault()?.Command.Name ?? null; if (firstOption != null) { result.Add(new ApplicationInsightsEntryFormat( From 76d51bb57cbbfb765f2a7cdd64e556bfabb155d7 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 20 Jan 2023 12:29:07 +0100 Subject: [PATCH 07/82] reduce lambda allocations --- src/Cli/dotnet/CommonOptions.cs | 5 +- .../commands/dotnet-complete/Complete.cs | 89 +++++++++---------- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index db8fc5c0b24c..ee293791dcd8 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -53,7 +53,6 @@ public static Option FrameworkOption(string description) => private static string RuntimeArgName = CommonLocalizableStrings.RuntimeIdentifierArgumentName; private static Func> RuntimeArgFunc = o => new string[] { $"-property:RuntimeIdentifier={o}", "-property:_CommandLineDefinedRuntimeIdentifier=true" }; - private static Func> RuntimeCompletions = Complete.RunTimesFromProjectFile; public static Option RuntimeOption = new ForwardedOption( @@ -61,7 +60,7 @@ public static Option FrameworkOption(string description) => { ArgumentHelpName = RuntimeArgName }.ForwardAsMany(RuntimeArgFunc) - .AddCompletions(RuntimeCompletions); + .AddCompletions(Complete.RunTimesFromProjectFile); public static Option LongFormRuntimeOption = new ForwardedOption( @@ -69,7 +68,7 @@ public static Option FrameworkOption(string description) => { ArgumentHelpName = RuntimeArgName }.ForwardAsMany(RuntimeArgFunc) - .AddCompletions(RuntimeCompletions); + .AddCompletions(Complete.RunTimesFromProjectFile); public static Option CurrentRuntimeOption(string description) => new ForwardedOption( diff --git a/src/Cli/dotnet/commands/dotnet-complete/Complete.cs b/src/Cli/dotnet/commands/dotnet-complete/Complete.cs index 4aa29b5eb30b..2c44d3d0c76a 100644 --- a/src/Cli/dotnet/commands/dotnet-complete/Complete.cs +++ b/src/Cli/dotnet/commands/dotnet-complete/Complete.cs @@ -2,8 +2,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; -using System.CommandLine; -using System.CommandLine.Parsing; using System.CommandLine.Completions; using System.IO; using System.Linq; @@ -17,63 +15,58 @@ namespace Microsoft.DotNet.Cli { internal static class Complete { + private static CompletionItem ToCompletionItem(string s) => new CompletionItem(s); - private static CompletionItem ToCompletionItem (string s) => new CompletionItem(s); - - public static Func> TargetFrameworksFromProjectFile => - (_context) => + public static IEnumerable TargetFrameworksFromProjectFile(CompletionContext _) + { + try { - try - { - return GetMSBuildProject()?.GetTargetFrameworks().Select(tf => tf.GetShortFolderName()).Select(ToCompletionItem) ?? Empty(); - } - catch (Exception) - { - return Empty(); - } - }; + return GetMSBuildProject()?.GetTargetFrameworks().Select(tf => tf.GetShortFolderName()).Select(ToCompletionItem) ?? Empty(); + } + catch (Exception) + { + return Empty(); + } + } private static void Report(Exception e) => Reporter.Verbose.WriteLine($"Exception occurred while getting completions: {e}"); - public static Func> RunTimesFromProjectFile => - (_context) => + public static IEnumerable RunTimesFromProjectFile(CompletionContext _) + { + try + { + return GetMSBuildProject()?.GetRuntimeIdentifiers().Select(ToCompletionItem) ?? Empty(); + } + catch (Exception) { - try - { - return GetMSBuildProject()?.GetRuntimeIdentifiers().Select(ToCompletionItem) ?? Empty(); - } - catch (Exception) - { - return Empty(); - } - }; + return Empty(); + } + } - public static Func> ProjectReferencesFromProjectFile => - (_context) => + public static IEnumerable ProjectReferencesFromProjectFile(CompletionContext _) + { + try + { + return GetMSBuildProject()?.GetProjectToProjectReferences().Select(r => ToCompletionItem(r.Include)) ?? Empty(); + } + catch (Exception) { - try - { - return GetMSBuildProject()?.GetProjectToProjectReferences().Select(r => ToCompletionItem(r.Include)) ?? Empty(); - } - catch (Exception) - { - return Empty(); - } - }; + return Empty(); + } + } - public static Func> ConfigurationsFromProjectFileOrDefaults => - (_context) => + public static IEnumerable ConfigurationsFromProjectFileOrDefaults(CompletionContext _) + { + try + { + return (GetMSBuildProject()?.GetConfigurations() ?? new[] { "Debug", "Release" }).Select(ToCompletionItem); + } + catch (Exception) { - try - { - return (GetMSBuildProject()?.GetConfigurations() ?? new[] { "Debug", "Release" }).Select(ToCompletionItem); - } - catch (Exception) - { - return Empty(); - } - }; + return Empty(); + } + } private static MsbuildProject GetMSBuildProject() { From c12b6391dacf62a399d85839fd5039e75e1d0302 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 20 Jan 2023 12:39:16 +0100 Subject: [PATCH 08/82] adopt to recent breaking changes: SetDefaultValue is now avilable only for Option, to avoid type mismatches (example: Option using default value as "abc") --- .../CliTemplateParameter.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs b/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs index 65eb2b2c5757..0fd01b17373a 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs @@ -5,6 +5,7 @@ using System.CommandLine; using System.CommandLine.Help; using System.CommandLine.Parsing; +using System.Diagnostics; using System.Globalization; using System.Text; using Microsoft.TemplateEngine.Abstractions; @@ -146,7 +147,14 @@ internal Option GetOption(IReadOnlySet aliases) if (!string.IsNullOrWhiteSpace(DefaultValue) || (Type == ParameterType.String || Type == ParameterType.Choice) && DefaultValue != null) { - option.SetDefaultValue(DefaultValue); + if (option is Option stringOption) + { + stringOption.SetDefaultValue(DefaultValue); + } + else + { + Debug.Fail($"Unexpected Option type: {option.GetType()}"); + } } option.Description = GetOptionDescription(); return option; From 4c8a5f4d7123383514e032582c01c5c0691765b3 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 20 Jan 2023 14:06:10 +0100 Subject: [PATCH 09/82] address one of the discovered problems --- .../CliTemplateParameter.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs b/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs index 52fa14f8cc2c..bd0e668b45bd 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/CliTemplateParameter.cs @@ -151,13 +151,23 @@ internal Option GetOption(IReadOnlySet aliases) if (!string.IsNullOrWhiteSpace(DefaultValue) || (Type == ParameterType.String || Type == ParameterType.Choice) && DefaultValue != null) { - if (option is Option stringOption) + switch (option) { - stringOption.SetDefaultValue(DefaultValue); - } - else - { - Debug.Fail($"Unexpected Option type: {option.GetType()}"); + case Option stringOption: + stringOption.SetDefaultValue(DefaultValue); + break; + case Option booleanOption: + booleanOption.SetDefaultValue(bool.Parse(DefaultValue)); + break; + case Option integerOption: + integerOption.SetDefaultValue(long.Parse(DefaultValue)); + break; + case Option floatOption: + floatOption.SetDefaultValue(float.Parse(DefaultValue)); + break; + default: + Debug.Fail($"Unexpected Option type: {option.GetType()}"); + break; } } } From dd5e23366f4e7d754f29231aed5930d9eb96a1d8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 20 Jan 2023 18:37:41 +0000 Subject: [PATCH 10/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230120.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.407001 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0aa47d1fa306..26e2049ba8e1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - 17ba8754454ce100f23994d83eaa75c6acba35ae + 92bd70e406fe4e3f021ff57706a636a7553792d2 - + https://github.com/dotnet/command-line-api - 17ba8754454ce100f23994d83eaa75c6acba35ae + 92bd70e406fe4e3f021ff57706a636a7553792d2 diff --git a/eng/Versions.props b/eng/Versions.props index 6a4c896f173c..3df626ffe7fb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23069.2 + 2.0.0-beta4.23070.1 1.0.0-preview5.1.22263.1 3.0.4496 From 03c78e40fac93c2df08cda4e12498bf48ae9dfd6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 20 Jan 2023 23:28:37 +0000 Subject: [PATCH 11/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230120.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.407002 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 26e2049ba8e1..c6f36f93095d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - 92bd70e406fe4e3f021ff57706a636a7553792d2 + daec22fb523da51206d3b4b0eb43d85cdff2afa8 - + https://github.com/dotnet/command-line-api - 92bd70e406fe4e3f021ff57706a636a7553792d2 + daec22fb523da51206d3b4b0eb43d85cdff2afa8 diff --git a/eng/Versions.props b/eng/Versions.props index 3df626ffe7fb..c5144dac8541 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23070.1 + 2.0.0-beta4.23070.2 1.0.0-preview5.1.22263.1 3.0.4496 From 0be3134cf9ded773b6f9d23211abc52bfbf66604 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 23 Jan 2023 19:19:31 +0000 Subject: [PATCH 12/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230123.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.407301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c6f36f93095d..18ce7abf8425 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - daec22fb523da51206d3b4b0eb43d85cdff2afa8 + 6524142f1398ed78eadfb9b802ba6492c6af63c4 - + https://github.com/dotnet/command-line-api - daec22fb523da51206d3b4b0eb43d85cdff2afa8 + 6524142f1398ed78eadfb9b802ba6492c6af63c4 diff --git a/eng/Versions.props b/eng/Versions.props index c5144dac8541..84ad80cb3e72 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23070.2 + 2.0.0-beta4.23073.1 1.0.0-preview5.1.22263.1 3.0.4496 From 397544bdb5e981e6ec2ef9f71c4dd042aa74c622 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 2 Feb 2023 17:49:09 +0000 Subject: [PATCH 13/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230202.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.410201 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 18ce7abf8425..a99429737305 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - 6524142f1398ed78eadfb9b802ba6492c6af63c4 + 506cb2f6a5cdd51b681b59309503e13e6ed5ed2d - + https://github.com/dotnet/command-line-api - 6524142f1398ed78eadfb9b802ba6492c6af63c4 + 506cb2f6a5cdd51b681b59309503e13e6ed5ed2d diff --git a/eng/Versions.props b/eng/Versions.props index 84ad80cb3e72..a7f43c7da650 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23073.1 + 2.0.0-beta4.23102.1 1.0.0-preview5.1.22263.1 3.0.4496 From 8a8e7d8be171bbc2605691aa0b3effde35ac551d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 2 Feb 2023 19:05:20 +0000 Subject: [PATCH 14/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230202.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.410202 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a99429737305..87f36a8fe02a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - 506cb2f6a5cdd51b681b59309503e13e6ed5ed2d + c95d8253394cc4f3ba30f89e88ede1716e0fd085 - + https://github.com/dotnet/command-line-api - 506cb2f6a5cdd51b681b59309503e13e6ed5ed2d + c95d8253394cc4f3ba30f89e88ede1716e0fd085 diff --git a/eng/Versions.props b/eng/Versions.props index a7f43c7da650..9a9baa809c3d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23102.1 + 2.0.0-beta4.23102.2 1.0.0-preview5.1.22263.1 3.0.4496 From 72684136507a0f73e6b67ee2db2f1669f2ac64c4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 2 Feb 2023 20:32:42 +0000 Subject: [PATCH 15/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230202.3 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.410203 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 87f36a8fe02a..7ddbb5e22c81 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - c95d8253394cc4f3ba30f89e88ede1716e0fd085 + 7030070c394c2d85dd10f6d1cc22ac6c1e902ce2 - + https://github.com/dotnet/command-line-api - c95d8253394cc4f3ba30f89e88ede1716e0fd085 + 7030070c394c2d85dd10f6d1cc22ac6c1e902ce2 diff --git a/eng/Versions.props b/eng/Versions.props index 9a9baa809c3d..db2a2376d318 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23102.2 + 2.0.0-beta4.23102.3 1.0.0-preview5.1.22263.1 3.0.4496 From 91f6fabc6b87f9679001d3b66d428100104e17cf Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 3 Feb 2023 18:57:34 +0000 Subject: [PATCH 16/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230203.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.410301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7ddbb5e22c81..35f003b8d748 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -246,13 +246,13 @@ 4512de66bb6e21c548ab0d5a83242b70969ba576 - + https://github.com/dotnet/command-line-api - 7030070c394c2d85dd10f6d1cc22ac6c1e902ce2 + 1bc03fed713b0b10455942d9f8eeab371d519cba - + https://github.com/dotnet/command-line-api - 7030070c394c2d85dd10f6d1cc22ac6c1e902ce2 + 1bc03fed713b0b10455942d9f8eeab371d519cba diff --git a/eng/Versions.props b/eng/Versions.props index db2a2376d318..f9bffb0069ba 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-alpha.1.23068.8 4.6.0 - 2.0.0-beta4.23102.3 + 2.0.0-beta4.23103.1 1.0.0-preview5.1.22263.1 3.0.4496 From 3f1c10ceb4aba5ea402f90dde6bba7389867c094 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 13 Feb 2023 17:39:48 +0000 Subject: [PATCH 17/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230213.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.411301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5fe7bee2c6f7..372d6487fcc1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 1bc03fed713b0b10455942d9f8eeab371d519cba + 76437b04511d88543df5cde2c7910e8d40e30888 - + https://github.com/dotnet/command-line-api - 1bc03fed713b0b10455942d9f8eeab371d519cba + 76437b04511d88543df5cde2c7910e8d40e30888 diff --git a/eng/Versions.props b/eng/Versions.props index 21f29a5e3e38..e4849269f793 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23103.1 + 2.0.0-beta4.23113.1 1.0.0-preview5.1.22263.1 3.0.4496 From 8c12a787c6c91b320849435e6b79325b421b9175 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 18 Feb 2023 21:59:43 +0000 Subject: [PATCH 18/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230218.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.411802 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 372d6487fcc1..5825dc24b831 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 76437b04511d88543df5cde2c7910e8d40e30888 + 64622889f74f14e8c515fb72be41846671c569ac - + https://github.com/dotnet/command-line-api - 76437b04511d88543df5cde2c7910e8d40e30888 + 64622889f74f14e8c515fb72be41846671c569ac diff --git a/eng/Versions.props b/eng/Versions.props index e4849269f793..89628e3616d0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23113.1 + 2.0.0-beta4.23118.2 1.0.0-preview5.1.22263.1 3.0.4496 From fe6e02bb5d51d6557df1f1fa16caa8cb3bf4fad5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 22 Feb 2023 20:20:58 +0000 Subject: [PATCH 19/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230222.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.412201 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5825dc24b831..a50dc0169816 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 64622889f74f14e8c515fb72be41846671c569ac + 8e8c69a73b7234460bfc9e718eed5939708d332c - + https://github.com/dotnet/command-line-api - 64622889f74f14e8c515fb72be41846671c569ac + 8e8c69a73b7234460bfc9e718eed5939708d332c diff --git a/eng/Versions.props b/eng/Versions.props index 89628e3616d0..99c0e98ab9b1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23118.2 + 2.0.0-beta4.23122.1 1.0.0-preview5.1.22263.1 3.0.4496 From 4e99936cde5f8347cb206c29bd2023ddf4bd078f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 22 Feb 2023 21:37:31 +0000 Subject: [PATCH 20/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230222.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.412202 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a50dc0169816..315d8c413ad2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 8e8c69a73b7234460bfc9e718eed5939708d332c + 2f15c7e27f5cfe353c1de82ec6bca73016e4dbb9 - + https://github.com/dotnet/command-line-api - 8e8c69a73b7234460bfc9e718eed5939708d332c + 2f15c7e27f5cfe353c1de82ec6bca73016e4dbb9 diff --git a/eng/Versions.props b/eng/Versions.props index 99c0e98ab9b1..8e5d6921d517 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23122.1 + 2.0.0-beta4.23122.2 1.0.0-preview5.1.22263.1 3.0.4496 From 46d264c464faa2dbaa411d030a09d12e6c19bcaa Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 2 Mar 2023 19:32:58 +0000 Subject: [PATCH 21/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230302.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.415201 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 315d8c413ad2..5a445efbed3f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 2f15c7e27f5cfe353c1de82ec6bca73016e4dbb9 + d5b63a05d9f4619dea0be897d3acc0ad5272874e - + https://github.com/dotnet/command-line-api - 2f15c7e27f5cfe353c1de82ec6bca73016e4dbb9 + d5b63a05d9f4619dea0be897d3acc0ad5272874e diff --git a/eng/Versions.props b/eng/Versions.props index 8e5d6921d517..5dfeb22049cb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23122.2 + 2.0.0-beta4.23152.1 1.0.0-preview5.1.22263.1 3.0.4496 From 6bec365d989b9cee1e19c2201baaf19846a2778a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 7 Mar 2023 19:33:20 +0000 Subject: [PATCH 22/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230307.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.415701 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5a445efbed3f..c4fc7e81b42b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - d5b63a05d9f4619dea0be897d3acc0ad5272874e + 259d24fa2ed4d9114bc560b68c1bb319f4d6dd39 - + https://github.com/dotnet/command-line-api - d5b63a05d9f4619dea0be897d3acc0ad5272874e + 259d24fa2ed4d9114bc560b68c1bb319f4d6dd39 diff --git a/eng/Versions.props b/eng/Versions.props index 5dfeb22049cb..b95f12f3d87a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23152.1 + 2.0.0-beta4.23157.1 1.0.0-preview5.1.22263.1 3.0.4496 From ecea358cdd3a48cd2a7b83f9b62bc9dc745d2d0e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 7 Mar 2023 20:37:40 +0000 Subject: [PATCH 23/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230307.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.415702 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c4fc7e81b42b..769c7cab1fb3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 259d24fa2ed4d9114bc560b68c1bb319f4d6dd39 + c63e231c1e5102c51bd9247a4f3feec9175d601d - + https://github.com/dotnet/command-line-api - 259d24fa2ed4d9114bc560b68c1bb319f4d6dd39 + c63e231c1e5102c51bd9247a4f3feec9175d601d diff --git a/eng/Versions.props b/eng/Versions.props index b95f12f3d87a..2f406226f4b6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23157.1 + 2.0.0-beta4.23157.2 1.0.0-preview5.1.22263.1 3.0.4496 From 7deda761ae0824fdce0d3c09b37aa84611e8f6ab Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 8 Mar 2023 17:30:36 +0000 Subject: [PATCH 24/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230308.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.415802 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 769c7cab1fb3..fb026b3d1298 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - c63e231c1e5102c51bd9247a4f3feec9175d601d + 3e0d47c1f468ad7047302d00d56c916bf303f636 - + https://github.com/dotnet/command-line-api - c63e231c1e5102c51bd9247a4f3feec9175d601d + 3e0d47c1f468ad7047302d00d56c916bf303f636 diff --git a/eng/Versions.props b/eng/Versions.props index 2f406226f4b6..b1e46d248fba 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23157.2 + 2.0.0-beta4.23158.2 1.0.0-preview5.1.22263.1 3.0.4496 From 0f80fca2bedf4d9a155d677ea0c8bf0210e1be39 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 13 Mar 2023 22:26:42 +0000 Subject: [PATCH 25/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230313.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fb026b3d1298..caa60ce3cfcf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 3e0d47c1f468ad7047302d00d56c916bf303f636 + e8e7b3c04117d6c64baff4ffae56fe78c09dd204 - + https://github.com/dotnet/command-line-api - 3e0d47c1f468ad7047302d00d56c916bf303f636 + e8e7b3c04117d6c64baff4ffae56fe78c09dd204 diff --git a/eng/Versions.props b/eng/Versions.props index b1e46d248fba..99544bd53cf8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23158.2 + 2.0.0-beta4.23163.1 1.0.0-preview5.1.22263.1 3.0.4496 From 37a7d3c34b432ca7ab2bce8ee6624bbbaf7f7294 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 14 Mar 2023 09:32:24 +0000 Subject: [PATCH 26/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230314.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416401 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index caa60ce3cfcf..7c6ec67b16a6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - e8e7b3c04117d6c64baff4ffae56fe78c09dd204 + 15a45d30410aafed67f231421733143e8f9168ab - + https://github.com/dotnet/command-line-api - e8e7b3c04117d6c64baff4ffae56fe78c09dd204 + 15a45d30410aafed67f231421733143e8f9168ab diff --git a/eng/Versions.props b/eng/Versions.props index 99544bd53cf8..99b2d1396445 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23163.1 + 2.0.0-beta4.23164.1 1.0.0-preview5.1.22263.1 3.0.4496 From 113fe8f374f488e9974bd0c206d8a294f379e7f5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 14 Mar 2023 18:29:14 +0000 Subject: [PATCH 27/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230314.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416402 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7c6ec67b16a6..9fcf649b7575 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 15a45d30410aafed67f231421733143e8f9168ab + 259d5a2e86a25e11b5d4f75d5b9fb695877498a4 - + https://github.com/dotnet/command-line-api - 15a45d30410aafed67f231421733143e8f9168ab + 259d5a2e86a25e11b5d4f75d5b9fb695877498a4 diff --git a/eng/Versions.props b/eng/Versions.props index 99b2d1396445..fe6189b52ff9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23164.1 + 2.0.0-beta4.23164.2 1.0.0-preview5.1.22263.1 3.0.4496 From 1af00d58158d02fc1fbaff03c844ac925fa61d05 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 15 Mar 2023 09:54:17 +0000 Subject: [PATCH 28/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230315.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416502 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9fcf649b7575..d880d7864c94 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 259d5a2e86a25e11b5d4f75d5b9fb695877498a4 + 4d1e6ac49a1fd0606862364aa5a2c6be2152ac16 - + https://github.com/dotnet/command-line-api - 259d5a2e86a25e11b5d4f75d5b9fb695877498a4 + 4d1e6ac49a1fd0606862364aa5a2c6be2152ac16 diff --git a/eng/Versions.props b/eng/Versions.props index fe6189b52ff9..02f72f9461e3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23164.2 + 2.0.0-beta4.23165.2 1.0.0-preview5.1.22263.1 3.0.4496 From c45ae0ed6870b589cb22740a254c8983133f3a85 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 15 Mar 2023 19:30:26 +0000 Subject: [PATCH 29/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230315.3 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416503 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d880d7864c94..3aad38ded790 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 4d1e6ac49a1fd0606862364aa5a2c6be2152ac16 + 42c58533cdf478b15120542be76f7cbaacaab024 - + https://github.com/dotnet/command-line-api - 4d1e6ac49a1fd0606862364aa5a2c6be2152ac16 + 42c58533cdf478b15120542be76f7cbaacaab024 diff --git a/eng/Versions.props b/eng/Versions.props index 02f72f9461e3..25936fdb02e0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23165.2 + 2.0.0-beta4.23165.3 1.0.0-preview5.1.22263.1 3.0.4496 From c145b9e9be6e1d32b0c54702f980c10c8a88bc2f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 16 Mar 2023 14:51:27 +0000 Subject: [PATCH 30/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230316.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416601 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3aad38ded790..96ae13928975 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 42c58533cdf478b15120542be76f7cbaacaab024 + 9e4d60b92ff1631e6fa7b90de0b4890c2a673efd - + https://github.com/dotnet/command-line-api - 42c58533cdf478b15120542be76f7cbaacaab024 + 9e4d60b92ff1631e6fa7b90de0b4890c2a673efd diff --git a/eng/Versions.props b/eng/Versions.props index 25936fdb02e0..a4e77ad8790e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23165.3 + 2.0.0-beta4.23166.1 1.0.0-preview5.1.22263.1 3.0.4496 From 83e6b297525fbf5538cc856b75322806945052ca Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 16 Mar 2023 16:57:51 +0000 Subject: [PATCH 31/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230316.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416602 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 96ae13928975..211c2ad355c0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 9e4d60b92ff1631e6fa7b90de0b4890c2a673efd + 3b5c4beb3e3d09702ba7d05b098f3594759188fd - + https://github.com/dotnet/command-line-api - 9e4d60b92ff1631e6fa7b90de0b4890c2a673efd + 3b5c4beb3e3d09702ba7d05b098f3594759188fd diff --git a/eng/Versions.props b/eng/Versions.props index a4e77ad8790e..5153307f1885 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23166.1 + 2.0.0-beta4.23166.2 1.0.0-preview5.1.22263.1 3.0.4496 From e7d3f2d7909c17f01ff6f25449814d7d9f1fca3c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 18 Mar 2023 09:54:22 +0000 Subject: [PATCH 32/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230318.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.416801 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 211c2ad355c0..9759d6de0053 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 3b5c4beb3e3d09702ba7d05b098f3594759188fd + 9ebcd90a3e2c80c0385aa24432a50d18f7f768b9 - + https://github.com/dotnet/command-line-api - 3b5c4beb3e3d09702ba7d05b098f3594759188fd + 9ebcd90a3e2c80c0385aa24432a50d18f7f768b9 diff --git a/eng/Versions.props b/eng/Versions.props index 5153307f1885..93d1f395de47 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23166.2 + 2.0.0-beta4.23168.1 1.0.0-preview5.1.22263.1 3.0.4496 From 5e200a7aa2c6746f06bcaeb4c2ef28d07107c2d1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 20 Mar 2023 17:53:21 +0000 Subject: [PATCH 33/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230320.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417001 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9759d6de0053..baa6a67dd290 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 9ebcd90a3e2c80c0385aa24432a50d18f7f768b9 + e4141051f34ecb23c68e6a29d94f91fbca1a5113 - + https://github.com/dotnet/command-line-api - 9ebcd90a3e2c80c0385aa24432a50d18f7f768b9 + e4141051f34ecb23c68e6a29d94f91fbca1a5113 diff --git a/eng/Versions.props b/eng/Versions.props index 93d1f395de47..62ae1e579287 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23168.1 + 2.0.0-beta4.23170.1 1.0.0-preview5.1.22263.1 3.0.4496 From c91fc88fca50ebc972b2818a0ffa096cf845a8e4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 21 Mar 2023 14:02:38 +0000 Subject: [PATCH 34/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230321.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417101 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index baa6a67dd290..d6b380bfeb60 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - e4141051f34ecb23c68e6a29d94f91fbca1a5113 + 02a776b901846b96cc2a7442b2032102944cafa9 - + https://github.com/dotnet/command-line-api - e4141051f34ecb23c68e6a29d94f91fbca1a5113 + 02a776b901846b96cc2a7442b2032102944cafa9 diff --git a/eng/Versions.props b/eng/Versions.props index 62ae1e579287..6feae3faf1b8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23170.1 + 2.0.0-beta4.23171.1 1.0.0-preview5.1.22263.1 3.0.4496 From 213425de2c84af37fe9965d9e0bcf970d080ea32 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 21 Mar 2023 20:57:25 +0000 Subject: [PATCH 35/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230321.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417102 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d6b380bfeb60..1cfac53bb513 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 02a776b901846b96cc2a7442b2032102944cafa9 + 48faa68ddcb8ba047cf9b1f2988bea2ba751aab8 - + https://github.com/dotnet/command-line-api - 02a776b901846b96cc2a7442b2032102944cafa9 + 48faa68ddcb8ba047cf9b1f2988bea2ba751aab8 diff --git a/eng/Versions.props b/eng/Versions.props index 6feae3faf1b8..ad25e2ff6ce0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23171.1 + 2.0.0-beta4.23171.2 1.0.0-preview5.1.22263.1 3.0.4496 From 5188b5db3d66447b852079726d0e2c899fe9111f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 22 Mar 2023 10:08:04 +0000 Subject: [PATCH 36/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230322.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417201 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1cfac53bb513..3529ee63d120 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 48faa68ddcb8ba047cf9b1f2988bea2ba751aab8 + 0403596afba9f622468d26c15a81fa17e881b1df - + https://github.com/dotnet/command-line-api - 48faa68ddcb8ba047cf9b1f2988bea2ba751aab8 + 0403596afba9f622468d26c15a81fa17e881b1df diff --git a/eng/Versions.props b/eng/Versions.props index ad25e2ff6ce0..3941b4073c51 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23171.2 + 2.0.0-beta4.23172.1 1.0.0-preview5.1.22263.1 3.0.4496 From 7ba6711189c7e5fd3f8ca5c4dec3fcfc7cb2786f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 24 Mar 2023 18:26:43 +0000 Subject: [PATCH 37/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230324.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417401 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3529ee63d120..e801092936ff 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 0403596afba9f622468d26c15a81fa17e881b1df + b90bff74067df7c75a8be5d4371a36d6051434ae - + https://github.com/dotnet/command-line-api - 0403596afba9f622468d26c15a81fa17e881b1df + b90bff74067df7c75a8be5d4371a36d6051434ae diff --git a/eng/Versions.props b/eng/Versions.props index 3941b4073c51..56947aad5558 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23172.1 + 2.0.0-beta4.23174.1 1.0.0-preview5.1.22263.1 3.0.4496 From a0e0cbc69a782d4981a065814b89b5b81b9f2e77 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 28 Mar 2023 17:09:50 +0000 Subject: [PATCH 38/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230328.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417801 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e801092936ff..4bb1adafb6e5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - b90bff74067df7c75a8be5d4371a36d6051434ae + 4185c6095d7cc672cd301a93ec307ae8995a4c98 - + https://github.com/dotnet/command-line-api - b90bff74067df7c75a8be5d4371a36d6051434ae + 4185c6095d7cc672cd301a93ec307ae8995a4c98 diff --git a/eng/Versions.props b/eng/Versions.props index 56947aad5558..9f48c6fc0bec 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23174.1 + 2.0.0-beta4.23178.1 1.0.0-preview5.1.22263.1 3.0.4496 From 82496ce0b70203789645462cf26c5ed2f10aa198 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 28 Mar 2023 18:14:44 +0000 Subject: [PATCH 39/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230328.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417802 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4bb1adafb6e5..8a9d7ec4b904 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 4185c6095d7cc672cd301a93ec307ae8995a4c98 + 649ddfc067f0b642dc748a6ad3a77927cfe8e414 - + https://github.com/dotnet/command-line-api - 4185c6095d7cc672cd301a93ec307ae8995a4c98 + 649ddfc067f0b642dc748a6ad3a77927cfe8e414 diff --git a/eng/Versions.props b/eng/Versions.props index 9f48c6fc0bec..68b0d2d07f1e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23178.1 + 2.0.0-beta4.23178.2 1.0.0-preview5.1.22263.1 3.0.4496 From 167fccf32ea2d51e883aba1b232875528833f3ea Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 28 Mar 2023 20:08:51 +0000 Subject: [PATCH 40/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230328.3 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417803 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8a9d7ec4b904..02e03b6f9408 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 649ddfc067f0b642dc748a6ad3a77927cfe8e414 + fe6635617044857050508a5c70856d82776572b1 - + https://github.com/dotnet/command-line-api - 649ddfc067f0b642dc748a6ad3a77927cfe8e414 + fe6635617044857050508a5c70856d82776572b1 diff --git a/eng/Versions.props b/eng/Versions.props index 68b0d2d07f1e..a8d3397786b7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23178.2 + 2.0.0-beta4.23178.3 1.0.0-preview5.1.22263.1 3.0.4496 From d1f4cd3e2402a47b841ae2710c4b259f1d185519 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 29 Mar 2023 08:50:31 +0000 Subject: [PATCH 41/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230329.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417901 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 02e03b6f9408..d1df53de45e2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - fe6635617044857050508a5c70856d82776572b1 + d18f598068fad37791e9f401a05d5f6a0591fa0e - + https://github.com/dotnet/command-line-api - fe6635617044857050508a5c70856d82776572b1 + d18f598068fad37791e9f401a05d5f6a0591fa0e diff --git a/eng/Versions.props b/eng/Versions.props index a8d3397786b7..672431d0d28f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23178.3 + 2.0.0-beta4.23179.1 1.0.0-preview5.1.22263.1 3.0.4496 From 0669ec234918344ea4f541cce40c4457d213648e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 29 Mar 2023 16:04:33 +0000 Subject: [PATCH 42/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230329.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417902 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d1df53de45e2..488813e78899 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - d18f598068fad37791e9f401a05d5f6a0591fa0e + 4ba4a2829e84d7d0c1d2a09a954a5d44630a7fae - + https://github.com/dotnet/command-line-api - d18f598068fad37791e9f401a05d5f6a0591fa0e + 4ba4a2829e84d7d0c1d2a09a954a5d44630a7fae diff --git a/eng/Versions.props b/eng/Versions.props index 672431d0d28f..9f941351eb9a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23179.1 + 2.0.0-beta4.23179.2 1.0.0-preview5.1.22263.1 3.0.4496 From 32538df36b6d69a740d4fa5a017ed627f08ef000 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 29 Mar 2023 17:14:30 +0000 Subject: [PATCH 43/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230329.3 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417903 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 488813e78899..e04bb407a407 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 4ba4a2829e84d7d0c1d2a09a954a5d44630a7fae + 7e845139f978d0e5377bcc0e06beae06c068f0e8 - + https://github.com/dotnet/command-line-api - 4ba4a2829e84d7d0c1d2a09a954a5d44630a7fae + 7e845139f978d0e5377bcc0e06beae06c068f0e8 diff --git a/eng/Versions.props b/eng/Versions.props index 9f941351eb9a..f3f8f0349fc2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23179.2 + 2.0.0-beta4.23179.3 1.0.0-preview5.1.22263.1 3.0.4496 From 70330ff9acfba31307874c816591ba6319979fe7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 29 Mar 2023 20:53:00 +0000 Subject: [PATCH 44/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230329.4 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.417904 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e04bb407a407..5bd2f3db78cd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 7e845139f978d0e5377bcc0e06beae06c068f0e8 + 0760996c3e81500804a8216d0585cecae0bd1265 - + https://github.com/dotnet/command-line-api - 7e845139f978d0e5377bcc0e06beae06c068f0e8 + 0760996c3e81500804a8216d0585cecae0bd1265 diff --git a/eng/Versions.props b/eng/Versions.props index f3f8f0349fc2..cd5395d6d867 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23179.3 + 2.0.0-beta4.23179.4 1.0.0-preview5.1.22263.1 3.0.4496 From d4f3b5f3411379e185716d70ba36370266b1aa3d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 30 Mar 2023 16:21:42 +0000 Subject: [PATCH 45/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230330.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418001 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5bd2f3db78cd..e3e388666c42 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 0760996c3e81500804a8216d0585cecae0bd1265 + 6706d6556d87da814ae0dfbfe5b2088f8d8e5617 - + https://github.com/dotnet/command-line-api - 0760996c3e81500804a8216d0585cecae0bd1265 + 6706d6556d87da814ae0dfbfe5b2088f8d8e5617 diff --git a/eng/Versions.props b/eng/Versions.props index cd5395d6d867..47f0e490dafa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23179.4 + 2.0.0-beta4.23180.1 1.0.0-preview5.1.22263.1 3.0.4496 From 799d1d659acce6ab5efca853bc13c70e1c162992 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 31 Mar 2023 12:43:56 +0000 Subject: [PATCH 46/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230331.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418101 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e3e388666c42..0c76ab7957f6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 6706d6556d87da814ae0dfbfe5b2088f8d8e5617 + 403234a4c4247151d09073bc07ccc13530ce62c6 - + https://github.com/dotnet/command-line-api - 6706d6556d87da814ae0dfbfe5b2088f8d8e5617 + 403234a4c4247151d09073bc07ccc13530ce62c6 diff --git a/eng/Versions.props b/eng/Versions.props index 47f0e490dafa..613dbf5fdd7c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23180.1 + 2.0.0-beta4.23181.1 1.0.0-preview5.1.22263.1 3.0.4496 From 91432385bff9bc0cec0af12c98c6991b01291db6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 31 Mar 2023 15:36:52 +0000 Subject: [PATCH 47/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230331.2 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418102 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0c76ab7957f6..9e57c5f65d30 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 403234a4c4247151d09073bc07ccc13530ce62c6 + b40ebf62dfe7b18822928eb3b09fa5297f6ac393 - + https://github.com/dotnet/command-line-api - 403234a4c4247151d09073bc07ccc13530ce62c6 + b40ebf62dfe7b18822928eb3b09fa5297f6ac393 diff --git a/eng/Versions.props b/eng/Versions.props index 613dbf5fdd7c..7833132e0630 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23181.1 + 2.0.0-beta4.23181.2 1.0.0-preview5.1.22263.1 3.0.4496 From 585e936a70761e8d8c69b6041614554f6d6a9822 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 31 Mar 2023 18:12:45 +0000 Subject: [PATCH 48/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230331.3 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418103 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9e57c5f65d30..b96e833c4ffc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - b40ebf62dfe7b18822928eb3b09fa5297f6ac393 + 6526806715d369c577b08a4efcc270f75a6f9317 - + https://github.com/dotnet/command-line-api - b40ebf62dfe7b18822928eb3b09fa5297f6ac393 + 6526806715d369c577b08a4efcc270f75a6f9317 diff --git a/eng/Versions.props b/eng/Versions.props index 7833132e0630..07bf23d9a03b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23181.2 + 2.0.0-beta4.23181.3 1.0.0-preview5.1.22263.1 3.0.4496 From c03f5a5783877fb8919f2c30b4e1b60e386b9ea3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 31 Mar 2023 19:45:22 +0000 Subject: [PATCH 49/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230331.4 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418104 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b96e833c4ffc..42c92f8a88ab 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - 6526806715d369c577b08a4efcc270f75a6f9317 + b7dfcd58912bc9442683339b712d33af09b01b97 - + https://github.com/dotnet/command-line-api - 6526806715d369c577b08a4efcc270f75a6f9317 + b7dfcd58912bc9442683339b712d33af09b01b97 diff --git a/eng/Versions.props b/eng/Versions.props index 07bf23d9a03b..dcefcd82221d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23181.3 + 2.0.0-beta4.23181.4 1.0.0-preview5.1.22263.1 3.0.4496 From 7ddfa936566284027cb6e0cbf13213b88b2e3d34 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 31 Mar 2023 22:19:39 +0000 Subject: [PATCH 50/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230331.5 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.418105 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 42c92f8a88ab..de1f4e448e52 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - b7dfcd58912bc9442683339b712d33af09b01b97 + e26fc94b029143e312d0aafdef2df99b9a5bdc31 - + https://github.com/dotnet/command-line-api - b7dfcd58912bc9442683339b712d33af09b01b97 + e26fc94b029143e312d0aafdef2df99b9a5bdc31 diff --git a/eng/Versions.props b/eng/Versions.props index dcefcd82221d..39590fd60c0d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23181.4 + 2.0.0-beta4.23181.5 1.0.0-preview5.1.22263.1 3.0.4496 From 8b78b3734d8199a1e3fbd7d1683c4f4a074dc3eb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 3 Apr 2023 09:09:11 +0000 Subject: [PATCH 51/82] Update dependencies from https://github.com/dotnet/command-line-api build 20230403.1 Microsoft.SourceBuild.Intermediate.command-line-api , System.CommandLine From Version 0.1.356401 -> To Version 0.1.420301 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index de1f4e448e52..3dc9220e5417 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -245,13 +245,13 @@ 1dc431ec828e9cc816fc69f89ad9b8286e74d707 - + https://github.com/dotnet/command-line-api - e26fc94b029143e312d0aafdef2df99b9a5bdc31 + 299ea1ce63170991db8551eee2f9828c0a1b4bde - + https://github.com/dotnet/command-line-api - e26fc94b029143e312d0aafdef2df99b9a5bdc31 + 299ea1ce63170991db8551eee2f9828c0a1b4bde diff --git a/eng/Versions.props b/eng/Versions.props index 39590fd60c0d..e110a08290a8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ 6.0.0 8.0.0-preview.2.23108.11 4.6.0 - 2.0.0-beta4.23181.5 + 2.0.0-beta4.23203.1 1.0.0-preview5.1.22263.1 3.0.4496 From ed5f5c55d2b76cbeac8a10bb4f602ea74b39b37c Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 3 Apr 2023 13:11:50 +0200 Subject: [PATCH 52/82] update to the latest version 1/N --- .../ValidatePackage.cs | 2 +- .../Program.cs | 303 ++++++++++-------- src/BlazorWasmSdk/Tool/Program.cs | 36 +-- src/BuiltInTools/dotnet-watch/Program.cs | 159 ++++----- .../Commands/BaseCommand.cs | 152 ++++----- .../Commands/CommandLineUtils.cs | 20 +- .../Commands/Example.cs | 42 +-- .../Commands/Extensions.cs | 2 +- .../Commands/FilterOptionDefinition.cs | 8 +- .../Commands/ITabularOutputCommand.cs | 4 +- .../Commands/NewCommand.Legacy.cs | 40 +-- .../Commands/NewCommand.cs | 16 +- .../Commands/SharedOptionsFactory.cs | 59 ++-- .../InstantiateCommand.NoMatchHandling.cs | 10 +- .../Commands/create/InstantiateCommand.cs | 4 +- .../Commands/create/TemplateCommand.cs | 10 +- .../Commands/install/BaseInstallCommand.cs | 8 +- .../Commands/install/LegacyInstallCommand.cs | 4 +- .../Commands/list/BaseListCommand.cs | 8 +- .../Commands/list/LegacyListCommand.cs | 4 +- .../Commands/search/BaseSearchCommand.cs | 6 +- .../Commands/search/LegacySearchCommand.cs | 4 +- .../uninstall/BaseUninstallCommand.cs | 2 +- .../Commands/update/BaseUpdateCommand.cs | 10 +- .../update/LegacyUpdateApplyCommand.cs | 4 +- .../update/LegacyUpdateCheckCommand.cs | 4 +- .../Commands/update/UpdateCommand.cs | 10 +- .../NewCommandFactory.cs | 2 +- src/Cli/dotnet-new3/CompleteCommand.cs | 4 +- src/Cli/dotnet-new3/New3CommandFactory.cs | 4 +- src/Cli/dotnet/CommonOptionsFactory.cs | 2 +- src/Cli/dotnet/DocumentedCommand.cs | 2 +- .../NugetSearch/NugetSearchApiParameter.cs | 2 +- src/Cli/dotnet/OptionForwardingExtensions.cs | 39 ++- src/Cli/dotnet/Parser.cs | 24 +- .../commands/dotnet-add/AddCommandParser.cs | 12 +- .../dotnet-add-package/AddPackageParser.cs | 49 +-- .../dotnet-add/dotnet-add-package/Program.cs | 9 +- .../AddProjectToProjectReferenceParser.cs | 21 +- .../commands/dotnet-build/BuildCommand.cs | 11 +- .../dotnet-build/BuildCommandParser.cs | 45 +-- .../BuildServerCommandParser.cs | 11 +- .../BuildServerShutdownCommandParser.cs | 18 +- .../dotnet-clean/CleanCommandParser.cs | 29 +- .../dotnet-complete/CompleteCommandParser.cs | 20 +- .../dotnet-complete/ParseCommandParser.cs | 14 +- .../dotnet-format/FormatCommandParser.cs | 10 +- .../commands/dotnet-fsi/FsiCommandParser.cs | 13 +- .../commands/dotnet-help/HelpCommandParser.cs | 14 +- ...ternalReportinstallsuccessCommandParser.cs | 16 +- .../commands/dotnet-list/ListCommandParser.cs | 10 +- .../ListPackageReferencesCommandParser.cs | 18 +- ...ProjectToProjectReferencesCommandParser.cs | 14 +- .../dotnet-msbuild/MSBuildCommandParser.cs | 12 +- .../commands/dotnet-new/NewCommandParser.cs | 50 +-- .../dotnet-nuget/NuGetCommandParser.cs | 138 ++++---- .../dotnet-workload/WorkloadCommandBase.cs | 2 +- .../dotnet-workload/WorkloadCommandParser.cs | 2 +- .../ParserTests/MiscTests.cs | 2 +- 59 files changed, 770 insertions(+), 780 deletions(-) diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Shared/ValidatePackage.cs b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Shared/ValidatePackage.cs index d5978d9c5a01..27704d0317df 100644 --- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Shared/ValidatePackage.cs +++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Shared/ValidatePackage.cs @@ -21,7 +21,7 @@ public static void Run(Func logFactory, bool enableRuleAttributesMustMatch, string[]? excludeAttributesFiles, bool enableRuleCannotChangeParameterName, - string packagePath, + string? packagePath, bool runApiCompat, bool enableStrictModeForCompatibleTfms, bool enableStrictModeForCompatibleFrameworksInPackage, diff --git a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs index 23646504b209..2c3cdc722ce6 100644 --- a/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs +++ b/src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs @@ -20,102 +20,133 @@ static int Main(string[] args) // Important: Keep parameters exposed in sync with the msbuild task frontend. // Global options - Option generateSuppressionFileOption = new("--generate-suppression-file", - "If true, generates a compatibility suppression file."); - Option suppressionFilesOption = new("--suppression-file", - "The path to one or more suppression files to read from.") + CliOption generateSuppressionFileOption = new("--generate-suppression-file") { - AllowMultipleArgumentsPerToken= true, + Description = "If true, generates a compatibility suppression file.", + Recursive = true + }; + CliOption suppressionFilesOption = new("--suppression-file") + { + Description = "The path to one or more suppression files to read from.", + AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore, - ArgumentHelpName = "file" + HelpName = "file", + Recursive = true + }; + CliOption suppressionOutputFileOption = new("--suppression-output-file") + { + Description = "The path to a suppression file to write to when --generate-suppression-file is true.", + Recursive = true + }; + CliOption noWarnOption = new("--noWarn") + { + Description = "A NoWarn string that allows to disable specific rules.", + Recursive = true + }; + CliOption respectInternalsOption = new("--respect-internals") + { + Description = "If true, includes both internal and public API.", + Recursive = true + }; + CliOption roslynAssembliesPathOption = new("--roslyn-assemblies-path") + { + Description = "The path to the directory that contains the Microsoft.CodeAnalysis assemblies.", + HelpName = "file", + Recursive = true + }; + CliOption verbosityOption = new("--verbosity", "-v") + { + Description = "Controls the log level verbosity. Allowed values are high, normal, and low.", + DefaultValueFactory = _ => MessageImportance.High, + Recursive = true + }; + CliOption enableRuleAttributesMustMatchOption = new("--enable-rule-attributes-must-match") + { + Description = "If true, enables rule to check that attributes match.", + Recursive = true + }; + CliOption excludeAttributesFilesOption = new("--exclude-attributes-file") + { + Description = "The path to one or more attribute exclusion files with types in DocId format.", + Recursive = true }; - Option suppressionOutputFileOption = new("--suppression-output-file", - "The path to a suppression file to write to when --generate-suppression-file is true."); - Option noWarnOption = new("--noWarn", - "A NoWarn string that allows to disable specific rules."); - Option respectInternalsOption = new("--respect-internals", - "If true, includes both internal and public API."); - Option roslynAssembliesPathOption = new("--roslyn-assemblies-path", - "The path to the directory that contains the Microsoft.CodeAnalysis assemblies.") - { - ArgumentHelpName = "file" + CliOption enableRuleCannotChangeParameterNameOption = new("--enable-rule-cannot-change-parameter-name") + { + Description = "If true, enables rule to check that the parameter names between public methods do not change.", + Recursive = true }; - Option verbosityOption = new(new string[] { "--verbosity", "-v" }, - "Controls the log level verbosity. Allowed values are high, normal, and low."); - verbosityOption.SetDefaultValue(MessageImportance.High); - Option enableRuleAttributesMustMatchOption = new("--enable-rule-attributes-must-match", - "If true, enables rule to check that attributes match."); - Option excludeAttributesFilesOption = new("--exclude-attributes-file", - "The path to one or more attribute exclusion files with types in DocId format."); - Option enableRuleCannotChangeParameterNameOption = new("--enable-rule-cannot-change-parameter-name", - "If true, enables rule to check that the parameter names between public methods do not change."); // Root command - Option leftAssembliesOption = new(new string[] { "--left-assembly", "--left", "-l" }, - description: "The path to one or more assemblies that serve as the left side to compare.", - parseArgument: ParseAssemblyArgument) + CliOption leftAssembliesOption = new("--left-assembly", "--left", "-l") { + Description = "The path to one or more assemblies that serve as the left side to compare.", + CustomParser = ParseAssemblyArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.OneOrMore, - IsRequired = true + Required = true }; - Option rightAssembliesOption = new(new string[] { "--right-assembly", "--right", "-r" }, - description: "The path to one or more assemblies that serve as the right side to compare.", - parseArgument: ParseAssemblyArgument) + CliOption rightAssembliesOption = new("--right-assembly", "--right", "-r") { + Description = "The path to one or more assemblies that serve as the right side to compare.", + CustomParser = ParseAssemblyArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.OneOrMore, - IsRequired = true + Required = true + }; + CliOption strictModeOption = new("--strict-mode") + { + Description = "If true, performs api compatibility checks in strict mode" }; - Option strictModeOption = new("--strict-mode", - "If true, performs api compatibility checks in strict mode"); - Option leftAssembliesReferencesOption = new(new string[] { "--left-assembly-references", "--lref" }, - description: "Paths to assembly references or the underlying directories for a given left. Values must be separated by commas: ','.", - parseArgument: ParseAssemblyReferenceArgument) + CliOption leftAssembliesReferencesOption = new("--left-assembly-references", "--lref") + { + Description = "Paths to assembly references or the underlying directories for a given left. Values must be separated by commas: ','.", + CustomParser = ParseAssemblyReferenceArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore, - ArgumentHelpName = "file1,file2,..." + HelpName = "file1,file2,..." }; - Option rightAssembliesReferencesOption = new(new string[] { "--right-assembly-references", "--rref" }, - description: "Paths to assembly references or the underlying directories for a given right. Values must be separated by commas: ','.", - parseArgument: ParseAssemblyReferenceArgument) + CliOption rightAssembliesReferencesOption = new("--right-assembly-references", "--rref") { + Description = "Paths to assembly references or the underlying directories for a given right. Values must be separated by commas: ','.", + CustomParser = ParseAssemblyReferenceArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore, - ArgumentHelpName = "file1,file2,..." + HelpName = "file1,file2,..." + }; + CliOption createWorkItemPerAssemblyOption = new("--create-work-item-per-assembly") + { + Description = "If true, enqueues a work item per passed in left and right assembly." }; - Option createWorkItemPerAssemblyOption = new("--create-work-item-per-assembly", - "If true, enqueues a work item per passed in left and right assembly."); - Option<(string, string)[]?> leftAssembliesTransformationPatternOption = new("--left-assemblies-transformation-pattern", - description: "A transformation pattern for the left side assemblies.", - parseArgument: ParseTransformationPattern) + CliOption<(string, string)[]?> leftAssembliesTransformationPatternOption = new("--left-assemblies-transformation-pattern") { + Description = "A transformation pattern for the left side assemblies.", + CustomParser = ParseTransformationPattern, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore }; - Option<(string, string)[]?> rightAssembliesTransformationPatternOption = new("--right-assemblies-transformation-pattern", - description: "A transformation pattern for the right side assemblies.", - parseArgument: ParseTransformationPattern) + CliOption<(string, string)[]?> rightAssembliesTransformationPatternOption = new("--right-assemblies-transformation-pattern") { + Description = "A transformation pattern for the right side assemblies.", + CustomParser = ParseTransformationPattern, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore }; - RootCommand rootCommand = new("Microsoft.DotNet.ApiCompat v" + Environment.Version.ToString(2)) + CliRootCommand rootCommand = new("Microsoft.DotNet.ApiCompat v" + Environment.Version.ToString(2)) { TreatUnmatchedTokensAsErrors = true }; - rootCommand.AddGlobalOption(generateSuppressionFileOption); - rootCommand.AddGlobalOption(suppressionFilesOption); - rootCommand.AddGlobalOption(suppressionOutputFileOption); - rootCommand.AddGlobalOption(noWarnOption); - rootCommand.AddGlobalOption(respectInternalsOption); - rootCommand.AddGlobalOption(roslynAssembliesPathOption); - rootCommand.AddGlobalOption(verbosityOption); - rootCommand.AddGlobalOption(enableRuleAttributesMustMatchOption); - rootCommand.AddGlobalOption(excludeAttributesFilesOption); - rootCommand.AddGlobalOption(enableRuleCannotChangeParameterNameOption); + rootCommand.Options.Add(generateSuppressionFileOption); + rootCommand.Options.Add(suppressionFilesOption); + rootCommand.Options.Add(suppressionOutputFileOption); + rootCommand.Options.Add(noWarnOption); + rootCommand.Options.Add(respectInternalsOption); + rootCommand.Options.Add(roslynAssembliesPathOption); + rootCommand.Options.Add(verbosityOption); + rootCommand.Options.Add(enableRuleAttributesMustMatchOption); + rootCommand.Options.Add(excludeAttributesFilesOption); + rootCommand.Options.Add(enableRuleCannotChangeParameterNameOption); rootCommand.Options.Add(leftAssembliesOption); rootCommand.Options.Add(rightAssembliesOption); @@ -126,31 +157,31 @@ static int Main(string[] args) rootCommand.Options.Add(leftAssembliesTransformationPatternOption); rootCommand.Options.Add(rightAssembliesTransformationPatternOption); - rootCommand.SetHandler((InvocationContext context) => + rootCommand.SetAction((ParseResult parseResult) => { // If a roslyn assemblies path isn't provided, use the compiled against version from a subfolder. - string roslynAssembliesPath = context.ParseResult.GetValue(roslynAssembliesPathOption) ?? + string roslynAssembliesPath = parseResult.GetValue(roslynAssembliesPathOption) ?? Path.Combine(AppContext.BaseDirectory, "codeanalysis"); RoslynResolver roslynResolver = RoslynResolver.Register(roslynAssembliesPath); - MessageImportance verbosity = context.ParseResult.GetValue(verbosityOption); - bool generateSuppressionFile = context.ParseResult.GetValue(generateSuppressionFileOption); - string[]? suppressionFiles = context.ParseResult.GetValue(suppressionFilesOption); - string? suppressionOutputFile = context.ParseResult.GetValue(suppressionOutputFileOption); - string? noWarn = context.ParseResult.GetValue(noWarnOption); - bool respectInternals = context.ParseResult.GetValue(respectInternalsOption); - bool enableRuleAttributesMustMatch = context.ParseResult.GetValue(enableRuleAttributesMustMatchOption); - string[]? excludeAttributesFiles = context.ParseResult.GetValue(excludeAttributesFilesOption); - bool enableRuleCannotChangeParameterName = context.ParseResult.GetValue(enableRuleCannotChangeParameterNameOption); + MessageImportance verbosity = parseResult.GetValue(verbosityOption); + bool generateSuppressionFile = parseResult.GetValue(generateSuppressionFileOption); + string[]? suppressionFiles = parseResult.GetValue(suppressionFilesOption); + string? suppressionOutputFile = parseResult.GetValue(suppressionOutputFileOption); + string? noWarn = parseResult.GetValue(noWarnOption); + bool respectInternals = parseResult.GetValue(respectInternalsOption); + bool enableRuleAttributesMustMatch = parseResult.GetValue(enableRuleAttributesMustMatchOption); + string[]? excludeAttributesFiles = parseResult.GetValue(excludeAttributesFilesOption); + bool enableRuleCannotChangeParameterName = parseResult.GetValue(enableRuleCannotChangeParameterNameOption); - string[] leftAssemblies = context.ParseResult.GetValue(leftAssembliesOption)!; - string[] rightAssemblies = context.ParseResult.GetValue(rightAssembliesOption)!; - bool strictMode = context.ParseResult.GetValue(strictModeOption); - string[][]? leftAssembliesReferences = context.ParseResult.GetValue(leftAssembliesReferencesOption); - string[][]? rightAssembliesReferences = context.ParseResult.GetValue(rightAssembliesReferencesOption); - bool createWorkItemPerAssembly = context.ParseResult.GetValue(createWorkItemPerAssemblyOption); - (string, string)[]? leftAssembliesTransformationPattern = context.ParseResult.GetValue(leftAssembliesTransformationPatternOption); - (string, string)[]? rightAssembliesTransformationPattern = context.ParseResult.GetValue(rightAssembliesTransformationPatternOption); + string[] leftAssemblies = parseResult.GetValue(leftAssembliesOption)!; + string[] rightAssemblies = parseResult.GetValue(rightAssembliesOption)!; + bool strictMode = parseResult.GetValue(strictModeOption); + string[][]? leftAssembliesReferences = parseResult.GetValue(leftAssembliesReferencesOption); + string[][]? rightAssembliesReferences = parseResult.GetValue(rightAssembliesReferencesOption); + bool createWorkItemPerAssembly = parseResult.GetValue(createWorkItemPerAssemblyOption); + (string, string)[]? leftAssembliesTransformationPattern = parseResult.GetValue(leftAssembliesTransformationPatternOption); + (string, string)[]? rightAssembliesTransformationPattern = parseResult.GetValue(rightAssembliesTransformationPatternOption); Func logFactory = (suppressionEngine) => new(suppressionEngine, verbosity); ValidateAssemblies.Run(logFactory, @@ -175,48 +206,56 @@ static int Main(string[] args) }); // Package command - Argument packageArgument = new("--package", - "The path to the package that should be validated") + CliArgument packageArgument = new("--package") { + Description = "The path to the package that should be validated", Arity = ArgumentArity.ExactlyOne }; - Option runtimeGraphOption = new("--runtime-graph", - "The path to the runtime graph to read from.") + CliOption runtimeGraphOption = new("--runtime-graph") + { + Description = "The path to the runtime graph to read from.", + HelpName = "json" + }; + CliOption runApiCompatOption = new("--run-api-compat") + { + Description = "If true, performs api compatibility checks on the package assets.", + DefaultValueFactory = _ => true + }; + CliOption enableStrictModeForCompatibleTfmsOption = new("--enable-strict-mode-for-compatible-tfms") + { + Description = "Validates api compatibility in strict mode for contract and implementation assemblies for all compatible target frameworks." + }; + CliOption enableStrictModeForCompatibleFrameworksInPackageOption = new("--enable-strict-mode-for-compatible-frameworks-in-package") + { + Description = "Validates api compatibility in strict mode for assemblies that are compatible based on their target framework." + }; + CliOption enableStrictModeForBaselineValidationOption = new("--enable-strict-mode-for-baseline-validation") { - ArgumentHelpName = "json" + Description = "Validates api compatibility in strict mode for package baseline checks." }; - Option runApiCompatOption = new("--run-api-compat", - "If true, performs api compatibility checks on the package assets."); - runApiCompatOption.SetDefaultValue(true); - Option enableStrictModeForCompatibleTfmsOption = new("--enable-strict-mode-for-compatible-tfms", - "Validates api compatibility in strict mode for contract and implementation assemblies for all compatible target frameworks."); - Option enableStrictModeForCompatibleFrameworksInPackageOption = new("--enable-strict-mode-for-compatible-frameworks-in-package", - "Validates api compatibility in strict mode for assemblies that are compatible based on their target framework."); - Option enableStrictModeForBaselineValidationOption = new("--enable-strict-mode-for-baseline-validation", - "Validates api compatibility in strict mode for package baseline checks."); - Option baselinePackageOption = new("--baseline-package", - "The path to a baseline package to validate against the current package.") - { - ArgumentHelpName = "nupkg" + CliOption baselinePackageOption = new("--baseline-package") + { + Description = "The path to a baseline package to validate against the current package.", + HelpName = "nupkg" }; - Option?> packageAssemblyReferencesOption = new("--package-assembly-references", - description: "Paths to assembly references or their underlying directories for a specific target framework in the package. Values must be separated by commas: ','.", - parseArgument: ParsePackageAssemblyReferenceArgument) + CliOption?> packageAssemblyReferencesOption = new("--package-assembly-references") { + Description = "Paths to assembly references or their underlying directories for a specific target framework in the package. Values must be separated by commas: ','.", + CustomParser = ParsePackageAssemblyReferenceArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore, - ArgumentHelpName = "tfm=file1,file2,..." + HelpName = "tfm=file1,file2,..." }; - Option?> baselinePackageAssemblyReferencesOption = new("--baseline-package-assembly-references", - description: "Paths to assembly references or their underlying directories for a specific target framework in the baseline package. Values must be separated by commas: ','.", - parseArgument: ParsePackageAssemblyReferenceArgument) + CliOption?> baselinePackageAssemblyReferencesOption = new("--baseline-package-assembly-references") { + Description = "Paths to assembly references or their underlying directories for a specific target framework in the baseline package. Values must be separated by commas: ','.", + CustomParser = ParsePackageAssemblyReferenceArgument, AllowMultipleArgumentsPerToken = true, Arity = ArgumentArity.ZeroOrMore, - ArgumentHelpName = "tfm=file1,file2,..." + HelpName = "tfm=file1,file2,..." }; - Command packageCommand = new("package", "Validates the compatibility of package assets"); + CliCommand packageCommand = new("package", "Validates the compatibility of package assets"); packageCommand.Arguments.Add(packageArgument); packageCommand.Options.Add(runtimeGraphOption); packageCommand.Options.Add(runApiCompatOption); @@ -226,32 +265,32 @@ static int Main(string[] args) packageCommand.Options.Add(baselinePackageOption); packageCommand.Options.Add(packageAssemblyReferencesOption); packageCommand.Options.Add(baselinePackageAssemblyReferencesOption); - packageCommand.SetHandler((InvocationContext context) => + packageCommand.SetAction((ParseResult parseResult) => { // If a roslyn assemblies path isn't provided, use the compiled against version from a subfolder. - string roslynAssembliesPath = context.ParseResult.GetValue(roslynAssembliesPathOption) ?? + string roslynAssembliesPath = parseResult.GetValue(roslynAssembliesPathOption) ?? Path.Combine(AppContext.BaseDirectory, "codeanalysis"); RoslynResolver roslynResolver = RoslynResolver.Register(roslynAssembliesPath); - MessageImportance verbosity = context.ParseResult.GetValue(verbosityOption); - bool generateSuppressionFile = context.ParseResult.GetValue(generateSuppressionFileOption); - string[]? suppressionFiles = context.ParseResult.GetValue(suppressionFilesOption); - string? suppressionOutputFile = context.ParseResult.GetValue(suppressionOutputFileOption); - string? noWarn = context.ParseResult.GetValue(noWarnOption); - bool respectInternals = context.ParseResult.GetValue(respectInternalsOption); - bool enableRuleAttributesMustMatch = context.ParseResult.GetValue(enableRuleAttributesMustMatchOption); - string[]? excludeAttributesFiles = context.ParseResult.GetValue(excludeAttributesFilesOption); - bool enableRuleCannotChangeParameterName = context.ParseResult.GetValue(enableRuleCannotChangeParameterNameOption); + MessageImportance verbosity = parseResult.GetValue(verbosityOption); + bool generateSuppressionFile = parseResult.GetValue(generateSuppressionFileOption); + string[]? suppressionFiles = parseResult.GetValue(suppressionFilesOption); + string? suppressionOutputFile = parseResult.GetValue(suppressionOutputFileOption); + string? noWarn = parseResult.GetValue(noWarnOption); + bool respectInternals = parseResult.GetValue(respectInternalsOption); + bool enableRuleAttributesMustMatch = parseResult.GetValue(enableRuleAttributesMustMatchOption); + string[]? excludeAttributesFiles = parseResult.GetValue(excludeAttributesFilesOption); + bool enableRuleCannotChangeParameterName = parseResult.GetValue(enableRuleCannotChangeParameterNameOption); - string package = context.ParseResult.GetValue(packageArgument); - bool runApiCompat = context.ParseResult.GetValue(runApiCompatOption); - bool enableStrictModeForCompatibleTfms = context.ParseResult.GetValue(enableStrictModeForCompatibleTfmsOption); - bool enableStrictModeForCompatibleFrameworksInPackage = context.ParseResult.GetValue(enableStrictModeForCompatibleFrameworksInPackageOption); - bool enableStrictModeForBaselineValidation = context.ParseResult.GetValue(enableStrictModeForBaselineValidationOption); - string? baselinePackage = context.ParseResult.GetValue(baselinePackageOption); - string? runtimeGraph = context.ParseResult.GetValue(runtimeGraphOption); - Dictionary? packageAssemblyReferences = context.ParseResult.GetValue(packageAssemblyReferencesOption); - Dictionary? baselinePackageAssemblyReferences = context.ParseResult.GetValue(baselinePackageAssemblyReferencesOption); + string? package = parseResult.GetValue(packageArgument); + bool runApiCompat = parseResult.GetValue(runApiCompatOption); + bool enableStrictModeForCompatibleTfms = parseResult.GetValue(enableStrictModeForCompatibleTfmsOption); + bool enableStrictModeForCompatibleFrameworksInPackage = parseResult.GetValue(enableStrictModeForCompatibleFrameworksInPackageOption); + bool enableStrictModeForBaselineValidation = parseResult.GetValue(enableStrictModeForBaselineValidationOption); + string? baselinePackage = parseResult.GetValue(baselinePackageOption); + string? runtimeGraph = parseResult.GetValue(runtimeGraphOption); + Dictionary? packageAssemblyReferences = parseResult.GetValue(packageAssemblyReferencesOption); + Dictionary? baselinePackageAssemblyReferences = parseResult.GetValue(baselinePackageAssemblyReferencesOption); Func logFactory = (suppressionEngine) => new(suppressionEngine, verbosity); ValidatePackage.Run(logFactory, @@ -277,7 +316,7 @@ static int Main(string[] args) }); rootCommand.Subcommands.Add(packageCommand); - return rootCommand.Invoke(args); + return rootCommand.Parse(args).Invoke(); } private static string[][] ParseAssemblyReferenceArgument(ArgumentResult argumentResult) @@ -310,7 +349,7 @@ private static (string CaptureGroupPattern, string ReplacementString)[]? ParseTr string[] parts = argumentResult.Tokens[i].Value.Split(';'); if (parts.Length != 2) { - argumentResult.ErrorMessage = "Invalid assemblies transformation pattern. Usage: {regex-pattern};{replacement-string}"; + argumentResult.AddError("Invalid assemblies transformation pattern. Usage: {regex-pattern};{replacement-string}"); continue; } @@ -328,7 +367,7 @@ private static (string CaptureGroupPattern, string ReplacementString)[]? ParseTr string[] parts = token.Value.Split('='); if (parts.Length != 2) { - argumentResult.ErrorMessage = "Invalid package assembly reference format {tfm=assembly1,assembly2,assembly3,...}"; + argumentResult.AddError("Invalid package assembly reference format {tfm=assembly1,assembly2,assembly3,...}"); continue; } @@ -337,7 +376,7 @@ private static (string CaptureGroupPattern, string ReplacementString)[]? ParseTr if (args.TryGetValue(tfm, out _)) { - argumentResult.ErrorMessage = $"Package assembly references for tfm '{tfm}' are already provided."; + argumentResult.AddError($"Package assembly references for tfm '{tfm}' are already provided."); continue; } diff --git a/src/BlazorWasmSdk/Tool/Program.cs b/src/BlazorWasmSdk/Tool/Program.cs index 4a1aa68e7637..43c494528be4 100644 --- a/src/BlazorWasmSdk/Tool/Program.cs +++ b/src/BlazorWasmSdk/Tool/Program.cs @@ -5,8 +5,6 @@ using System; using System.Collections.Generic; using System.CommandLine; -using System.CommandLine.Invocation; -using System.CommandLine.Parsing; using System.IO; using System.IO.Compression; using System.Threading.Tasks; @@ -17,23 +15,22 @@ internal static class Program { public static int Main(string[] args) { - var rootCommand = new RootCommand(); - var brotli = new Command("brotli"); + CliRootCommand rootCommand = new(); + CliCommand brotli = new("brotli"); - var compressionLevelOption = new Option( - "-c", - defaultValueFactory: () => CompressionLevel.SmallestSize, - description: "System.IO.Compression.CompressionLevel for the Brotli compression algorithm."); - var sourcesOption = new Option>( - "-s", - description: "A list of files to compress.") + CliOption compressionLevelOption = new("-c") { + DefaultValueFactory = _ => CompressionLevel.SmallestSize, + Description = "System.IO.Compression.CompressionLevel for the Brotli compression algorithm.", + }; + CliOption> sourcesOption = new("-s") + { + Description = "A list of files to compress.", AllowMultipleArgumentsPerToken = false }; - var outputsOption = new Option>( - "-o", - "The filenames to output the compressed file to.") + CliOption> outputsOption = new("-o") { + Description = "The filenames to output the compressed file to.", AllowMultipleArgumentsPerToken = false }; @@ -43,12 +40,11 @@ public static int Main(string[] args) rootCommand.Add(brotli); - brotli.SetHandler((InvocationContext context) => + brotli.SetAction((ParseResult parseResult) => { - var parseResults = context.ParseResult; - var c = parseResults.GetValue(compressionLevelOption); - var s = parseResults.GetValue(sourcesOption); - var o = parseResults.GetValue(outputsOption); + var c = parseResult.GetValue(compressionLevelOption); + var s = parseResult.GetValue(sourcesOption); + var o = parseResult.GetValue(outputsOption); Parallel.For(0, s.Count, i => { @@ -70,7 +66,7 @@ public static int Main(string[] args) }); }); - return rootCommand.InvokeAsync(args).Result; + return rootCommand.Parse(args).Invoke(); } } } diff --git a/src/BuiltInTools/dotnet-watch/Program.cs b/src/BuiltInTools/dotnet-watch/Program.cs index f600d3896c7d..2822a0fce5a7 100644 --- a/src/BuiltInTools/dotnet-watch/Program.cs +++ b/src/BuiltInTools/dotnet-watch/Program.cs @@ -3,11 +3,7 @@ using System; using System.Runtime.Loader; -using System.Collections.Generic; using System.CommandLine; -using System.CommandLine.Binding; -using System.CommandLine.Invocation; -using System.CommandLine.Parsing; using System.IO; using System.Linq; using System.Threading; @@ -122,43 +118,49 @@ public static async Task Main(string[] args) } } - internal async Task RunAsync(string[] args) + internal Task RunAsync(string[] args) { - var rootCommand = CreateRootCommand(HandleWatch, _reporter); - return await rootCommand.InvokeAsync(args); + CliCommand rootCommand = CreateRootCommand(HandleWatch, _reporter); + return rootCommand.Parse(args).InvokeAsync(_cts.Token); } - internal static RootCommand CreateRootCommand(Func> handler, IReporter reporter) + internal static CliRootCommand CreateRootCommand(Func> handler, IReporter reporter) { - var quiet = new Option( - new[] { "--quiet", "-q" }, - "Suppresses all output except warnings and errors"); + CliOption quiet = new("--quiet", "-q") + { + Description = "Suppresses all output except warnings and errors" + }; - var verbose = new Option( - new[] { "--verbose", "-v" }, - "Show verbose output"); + CliOption verbose = new("--verbose", "-v") + { + Description = "Show verbose output" + }; verbose.Validators.Add(v => { if (v.FindResultFor(quiet) is not null && v.FindResultFor(verbose) is not null) { - v.ErrorMessage = Resources.Error_QuietAndVerboseSpecified; + v.AddError(Resources.Error_QuietAndVerboseSpecified); } }); - var listOption = new Option("--list", "Lists all discovered files without starting the watcher."); - var shortProjectOption = new Option("-p", "The project to watch.") { IsHidden = true }; - var longProjectOption = new Option("--project","The project to watch"); - var launchProfileOption = new Option(new[] { "-lp", "--launch-profile" }, "The launch profile to start the project with (case-sensitive). " + - "This option is only supported when running 'dotnet watch' or 'dotnet watch run'."); - var noHotReloadOption = new Option("--no-hot-reload", "Suppress hot reload for supported apps."); - var nonInteractiveOption = new Option( - "--non-interactive", - "Runs dotnet-watch in non-interactive mode. This option is only supported when running with Hot Reload enabled. " + - "Use this option to prevent console input from being captured."); - var forwardedArguments = new Argument("forwardedArgs", "Arguments to pass to the child dotnet process."); - - var root = new RootCommand(Description) + CliOption listOption = new("--list") { Description = "Lists all discovered files without starting the watcher." }; + CliOption shortProjectOption = new("-p") { Description = "The project to watch.", Hidden = true }; + CliOption longProjectOption = new("--project") { Description = "The project to watch" }; + CliOption launchProfileOption = new("--launch-profile", "-lp") + { + Description = "The launch profile to start the project with (case-sensitive). " + + "This option is only supported when running 'dotnet watch' or 'dotnet watch run'." + }; + CliOption noHotReloadOption = new("--no-hot-reload") { Description = "Suppress hot reload for supported apps." }; + CliOption nonInteractiveOption = new("--non-interactive") + { + Description = "Runs dotnet-watch in non-interactive mode. This option is only supported when running with Hot Reload enabled. " + + "Use this option to prevent console input from being captured." + }; + CliArgument forwardedArguments = new("forwardedArgs") { Description = "Arguments to pass to the child dotnet process." }; + + CliRootCommand root = new (Description) { quiet, verbose, @@ -171,8 +173,36 @@ internal static RootCommand CreateRootCommand(Func forwardedArguments }; - var binder = new CommandLineOptionsBinder(longProjectOption, shortProjectOption, launchProfileOption, quiet, listOption, noHotReloadOption, nonInteractiveOption, verbose, forwardedArguments, reporter); - root.SetHandler((CommandLineOptions options) => handler(options), binder); + root.SetAction((ParseResult parseResult, CancellationToken cancellationToken) => + { + string projectValue = parseResult.GetValue(longProjectOption); + if (string.IsNullOrEmpty(projectValue)) + { +#pragma warning disable CS0618 // Type or member is obsolete + var projectShortValue = parseResult.GetValue(shortProjectOption); +#pragma warning restore CS0618 // Type or member is obsolete + if (!string.IsNullOrEmpty(projectShortValue)) + { + reporter.Warn(Resources.Warning_ProjectAbbreviationDeprecated); + projectValue = projectShortValue; + } + } + + CommandLineOptions options = new() + { + Quiet = parseResult.GetValue(quiet), + List = parseResult.GetValue(listOption), + NoHotReload = parseResult.GetValue(noHotReloadOption), + NonInteractive = parseResult.GetValue(nonInteractiveOption), + Verbose = parseResult.GetValue(verbose), + Project = projectValue, + LaunchProfile = parseResult.GetValue(launchProfileOption), + RemainingArguments = parseResult.GetValue(forwardedArguments), + }; + + return handler(options); + + }); return root; } @@ -433,74 +463,5 @@ private static void RegisterAssemblyResolutionEvents(string sdkRootDirectory) return null; }; } - private sealed class CommandLineOptionsBinder : BinderBase - { - private readonly Option _longProjectOption; - private readonly Option _shortProjectOption; - private readonly Option _launchProfileOption; - private readonly Option _quietOption; - private readonly Option _listOption; - private readonly Option _noHotReloadOption; - private readonly Option _nonInteractiveOption; - private readonly Option _verboseOption; - - private readonly Argument _argumentsToForward; - private readonly IReporter _reporter; - - internal CommandLineOptionsBinder( - Option longProjectOption, - Option shortProjectOption, - Option launchProfileOption, - Option quietOption, - Option listOption, - Option noHotReloadOption, - Option nonInteractiveOption, - Option verboseOption, - Argument argumentsToForward, - IReporter reporter) - { - _longProjectOption = longProjectOption; - _shortProjectOption = shortProjectOption; - _launchProfileOption = launchProfileOption; - _quietOption = quietOption; - _listOption = listOption; - _noHotReloadOption = noHotReloadOption; - _nonInteractiveOption = nonInteractiveOption; - _verboseOption = verboseOption; - _argumentsToForward = argumentsToForward; - _reporter = reporter; - } - - protected override CommandLineOptions GetBoundValue(BindingContext bindingContext) - { - var parseResults = bindingContext.ParseResult; - var projectValue = parseResults.GetValue(_longProjectOption); - if (string.IsNullOrEmpty(projectValue)) - { -#pragma warning disable CS0618 // Type or member is obsolete - var projectShortValue = parseResults.GetValue(_shortProjectOption); -#pragma warning restore CS0618 // Type or member is obsolete - if (!string.IsNullOrEmpty(projectShortValue)) - { - _reporter.Warn(Resources.Warning_ProjectAbbreviationDeprecated); - projectValue = projectShortValue; - } - } - - var options = new CommandLineOptions - { - Quiet = parseResults.GetValue(_quietOption), - List = parseResults.GetValue(_listOption), - NoHotReload = parseResults.GetValue(_noHotReloadOption), - NonInteractive = parseResults.GetValue(_nonInteractiveOption), - Verbose = parseResults.GetValue(_verboseOption), - Project = projectValue, - LaunchProfile = parseResults.GetValue(_launchProfileOption), - RemainingArguments = parseResults.GetValue(_argumentsToForward), - }; - return options; - } - } } - } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs index a665b58a12e3..f4525ce50a67 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs @@ -4,7 +4,6 @@ using System.CommandLine; using System.CommandLine.Completions; -using System.CommandLine.Invocation; using System.Reflection; using Microsoft.DotNet.Cli.Utils; using Microsoft.TemplateEngine.Abstractions; @@ -13,11 +12,10 @@ using Microsoft.TemplateEngine.Edge; using Microsoft.TemplateEngine.Edge.Settings; using Microsoft.TemplateEngine.Utils; -using Command = System.CommandLine.Command; namespace Microsoft.TemplateEngine.Cli.Commands { - internal abstract class BaseCommand : Command + internal abstract class BaseCommand : CliCommand { private readonly Func _hostBuilder; @@ -50,7 +48,7 @@ protected IEngineEnvironmentSettings CreateEnvironmentSettings(GlobalArgs args, } } - internal abstract class BaseCommand : BaseCommand, ICommandHandler where TArgs : GlobalArgs + internal abstract class BaseCommand : BaseCommand where TArgs : GlobalArgs { internal BaseCommand( Func hostBuilder, @@ -58,70 +56,9 @@ internal BaseCommand( string description) : base(hostBuilder, name, description) { - this.Handler = this; + Action = new CommandAction(this); } - public async Task InvokeAsync(InvocationContext context) - { - TArgs args = ParseContext(context.ParseResult); - using IEngineEnvironmentSettings environmentSettings = CreateEnvironmentSettings(args, context.ParseResult); - using TemplatePackageManager templatePackageManager = new(environmentSettings); - CancellationToken cancellationToken = context.GetCancellationToken(); - - NewCommandStatus returnCode; - - try - { - using (Timing.Over(environmentSettings.Host.Logger, "Execute")) - { - await HandleGlobalOptionsAsync(args, environmentSettings, templatePackageManager, cancellationToken).ConfigureAwait(false); - returnCode = await ExecuteAsync(args, environmentSettings, templatePackageManager, context).ConfigureAwait(false); - } - } - catch (Exception ex) - { - AggregateException? ax = ex as AggregateException; - - while (ax != null && ax.InnerExceptions.Count == 1 && ax.InnerException is not null) - { - ex = ax.InnerException; - ax = ex as AggregateException; - } - - Reporter.Error.WriteLine(ex.Message.Bold().Red()); - - while (ex.InnerException != null) - { - ex = ex.InnerException; - ax = ex as AggregateException; - - while (ax != null && ax.InnerExceptions.Count == 1 && ax.InnerException is not null) - { - ex = ax.InnerException; - ax = ex as AggregateException; - } - - Reporter.Error.WriteLine(ex.Message.Bold().Red()); - } - - if (!string.IsNullOrWhiteSpace(ex.StackTrace)) - { - Reporter.Error.WriteLine(ex.StackTrace.Bold().Red()); - } - returnCode = NewCommandStatus.Unexpected; - } - - if (returnCode != NewCommandStatus.Success) - { - Reporter.Error.WriteLine(); - Reporter.Error.WriteLine(LocalizableStrings.BaseCommand_ExitCodeHelp, (int)returnCode); - } - - return (int)returnCode; - } - - public int Invoke(InvocationContext context) => InvokeAsync(context).GetAwaiter().GetResult(); - public override IEnumerable GetCompletions(CompletionContext context) { if (context.ParseResult == null) @@ -148,7 +85,7 @@ protected internal static async Task CheckTemplatesWithSubCommandName( CancellationToken cancellationToken) { IReadOnlyList availableTemplates = await templatePackageManager.GetTemplatesAsync(cancellationToken).ConfigureAwait(false); - string usedCommandAlias = args.ParseResult.CommandResult.Token.Value; + string usedCommandAlias = args.ParseResult.CommandResult.IdentifierToken.Value; if (!availableTemplates.Any(t => t.ShortNameList.Any(sn => string.Equals(sn, usedCommandAlias, StringComparison.OrdinalIgnoreCase)))) { return; @@ -159,7 +96,9 @@ protected internal static async Task CheckTemplatesWithSubCommandName( Reporter.Output.WriteLine(); } - protected static void PrintDeprecationMessage(ParseResult parseResult, Option? additionalOption = null) where TDepr : Command where TNew : Command + protected static void PrintDeprecationMessage(ParseResult parseResult, CliOption? additionalOption = null) + where TDepr : CliCommand + where TNew : CliCommand { var newCommandExample = Example.For(parseResult); if (additionalOption != null) @@ -177,21 +116,21 @@ protected static void PrintDeprecationMessage(ParseResult parseResu Reporter.Output.WriteLine(); } - protected abstract Task ExecuteAsync(TArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, InvocationContext context); + protected abstract Task ExecuteAsync(TArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, ParseResult parseResult, CancellationToken cancellationToken); protected abstract TArgs ParseContext(ParseResult parseResult); - protected virtual Option GetFilterOption(FilterOptionDefinition def) + protected virtual CliOption GetFilterOption(FilterOptionDefinition def) { return def.OptionFactory(); } - protected IReadOnlyDictionary SetupFilterOptions(IReadOnlyList filtersToSetup) + protected IReadOnlyDictionary SetupFilterOptions(IReadOnlyList filtersToSetup) { - Dictionary options = new(); + Dictionary options = new(); foreach (FilterOptionDefinition filterDef in filtersToSetup) { - Option newOption = GetFilterOption(filterDef); + CliOption newOption = GetFilterOption(filterDef); this.Options.Add(newOption); options[filterDef] = newOption; } @@ -280,5 +219,72 @@ private static void HandleDebugShowConfig(TArgs args, IEngineEnvironmentSettings Reporter.Output.WriteLine(generatorsFormatter.Layout()); Reporter.Output.WriteLine(); } + + private sealed class CommandAction : CliAction + { + private readonly BaseCommand _command; + + public CommandAction(BaseCommand command) => _command = command; + + public override async Task InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken) + { + TArgs args = _command.ParseContext(parseResult); + using IEngineEnvironmentSettings environmentSettings = _command.CreateEnvironmentSettings(args, parseResult); + using TemplatePackageManager templatePackageManager = new(environmentSettings); + + NewCommandStatus returnCode; + + try + { + using (Timing.Over(environmentSettings.Host.Logger, "Execute")) + { + await HandleGlobalOptionsAsync(args, environmentSettings, templatePackageManager, cancellationToken).ConfigureAwait(false); + returnCode = await _command.ExecuteAsync(args, environmentSettings, templatePackageManager, parseResult, cancellationToken).ConfigureAwait(false); + } + } + catch (Exception ex) + { + AggregateException? ax = ex as AggregateException; + + while (ax != null && ax.InnerExceptions.Count == 1 && ax.InnerException is not null) + { + ex = ax.InnerException; + ax = ex as AggregateException; + } + + Reporter.Error.WriteLine(ex.Message.Bold().Red()); + + while (ex.InnerException != null) + { + ex = ex.InnerException; + ax = ex as AggregateException; + + while (ax != null && ax.InnerExceptions.Count == 1 && ax.InnerException is not null) + { + ex = ax.InnerException; + ax = ex as AggregateException; + } + + Reporter.Error.WriteLine(ex.Message.Bold().Red()); + } + + if (!string.IsNullOrWhiteSpace(ex.StackTrace)) + { + Reporter.Error.WriteLine(ex.StackTrace.Bold().Red()); + } + returnCode = NewCommandStatus.Unexpected; + } + + if (returnCode != NewCommandStatus.Success) + { + Reporter.Error.WriteLine(); + Reporter.Error.WriteLine(LocalizableStrings.BaseCommand_ExitCodeHelp, (int)returnCode); + } + + return (int)returnCode; + } + + public override int Invoke(ParseResult parseResult) => InvokeAsync(parseResult, CancellationToken.None).GetAwaiter().GetResult(); + } } } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/CommandLineUtils.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/CommandLineUtils.cs index 58b48038c983..32cc09b4c3f4 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/CommandLineUtils.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/CommandLineUtils.cs @@ -11,7 +11,7 @@ internal class CommandLineUtils { // This code is from System.CommandLine, HelpBuilder class. // Ideally those methods are exposed, we may switch to use them. - internal static string FormatArgumentUsage(IReadOnlyList arguments) + internal static string FormatArgumentUsage(IReadOnlyList arguments) { var sb = new StringBuilder(); var end = default(Stack); @@ -19,7 +19,7 @@ internal static string FormatArgumentUsage(IReadOnlyList arguments) for (var i = 0; i < arguments.Count; i++) { var argument = arguments[i]; - if (argument.IsHidden) + if (argument.Hidden) { continue; } @@ -58,20 +58,20 @@ internal static string FormatArgumentUsage(IReadOnlyList arguments) } return sb.ToString(); - bool IsMultiParented(Argument argument) => + bool IsMultiParented(CliArgument argument) => argument.Parents.Count() > 1; - bool IsOptional(Argument argument) => + bool IsOptional(CliArgument argument) => IsMultiParented(argument) || argument.Arity.MinimumNumberOfValues == 0; } - internal static string FormatArgumentUsage(Argument argument) => FormatArgumentUsage(new[] { argument }); + internal static string FormatArgumentUsage(CliArgument argument) => FormatArgumentUsage(new[] { argument }); - internal static string FormatArgumentUsage(Option option) => FormatArgumentUsage(new[] { option }); + internal static string FormatArgumentUsage(CliOption option) => FormatArgumentUsage(new[] { option }); // separate instance as Option.Argument is internal. - internal static string FormatArgumentUsage(IReadOnlyList internal class FilterOptionDefinition { - internal FilterOptionDefinition(Func