From d3db023055e7ba77a7494019080f230bb2ba51ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:04:07 +0000 Subject: [PATCH] (deps): Bump System.CommandLine (#4392) Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/command-line-api). Updates `System.CommandLine` from 2.0.0-beta4.25071.2 to 2.0.0-beta4.25072.1 - [Release notes](https://github.com/dotnet/command-line-api/releases) - [Changelog](https://github.com/dotnet/command-line-api/blob/main/docs/History.md) - [Commits](https://github.com/dotnet/command-line-api/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- new-cli/Directory.Packages.props | 2 +- new-cli/GitVersion.Cli.Generator/Content.cs | 14 +++++++------- new-cli/GitVersion.Cli/GitVersionApp.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index aef8122b03..f6442ac986 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + \ No newline at end of file diff --git a/new-cli/GitVersion.Cli.Generator/Content.cs b/new-cli/GitVersion.Cli.Generator/Content.cs index f3a2484a68..edde296b9f 100644 --- a/new-cli/GitVersion.Cli.Generator/Content.cs +++ b/new-cli/GitVersion.Cli.Generator/Content.cs @@ -27,7 +27,7 @@ public static class Content namespace {{Namespace}}; -public class {{Model.CommandTypeName}}Impl : CliCommand, ICommandImpl +public class {{Model.CommandTypeName}}Impl : Command, ICommandImpl { public string CommandName => nameof({{Model.CommandTypeName}}Impl); {{- if (Model.ParentCommand | string.empty) }} @@ -38,14 +38,14 @@ public class {{Model.CommandTypeName}}Impl : CliCommand, ICommandImpl {{- $settingsProperties = Model.SettingsProperties | array.sort "Name" }} // Options list {{~ for $prop in $settingsProperties ~}} - protected readonly CliOption<{{$prop.TypeName}}> {{$prop.Name}}Option; + protected readonly Option<{{$prop.TypeName}}> {{$prop.Name}}Option; {{~ end ~}} public {{Model.CommandTypeName}}Impl({{Model.CommandTypeName}} command) : base("{{Model.CommandName}}", "{{Model.CommandDescription}}") { {{~ for $prop in $settingsProperties ~}} - {{$prop.Name}}Option = new CliOption<{{$prop.TypeName}}>("{{$prop.OptionName}}", [{{$prop.Aliases}}]) + {{$prop.Name}}Option = new Option<{{$prop.TypeName}}>("{{$prop.OptionName}}", [{{$prop.Aliases}}]) { Required = {{$prop.Required}}, Description = "{{$prop.Description}}", @@ -80,7 +80,7 @@ Task Run(ParseResult parseResult, CancellationToken cancellationToken) using {{InfraNamespaceName}}; namespace {{Namespace}}; -public class RootCommandImpl : CliRootCommand +public class RootCommandImpl : RootCommand { public RootCommandImpl(IEnumerable commands) { @@ -94,12 +94,12 @@ private void AddCommand(ICommandImpl command, IDictionary { if (!string.IsNullOrWhiteSpace(command.ParentCommandName)) { - var parent = map[command.ParentCommandName] as CliCommand; - parent?.Add((CliCommand)command); + var parent = map[command.ParentCommandName] as Command; + parent?.Add((Command)command); } else { - Add((CliCommand)command); + Add((Command)command); } } } diff --git a/new-cli/GitVersion.Cli/GitVersionApp.cs b/new-cli/GitVersion.Cli/GitVersionApp.cs index d873b38bcd..7c9d1854d1 100644 --- a/new-cli/GitVersion.Cli/GitVersionApp.cs +++ b/new-cli/GitVersion.Cli/GitVersionApp.cs @@ -13,7 +13,7 @@ internal class GitVersionApp(RootCommandImpl rootCommand) public Task RunAsync(string[] args, CancellationToken cancellationToken) { - var cliConfiguration = new CliConfiguration(rootCommand); + var cliConfiguration = new CommandLineConfiguration(rootCommand); var parseResult = cliConfiguration.Parse(args); var logFile = parseResult.GetValue(GitVersionSettings.LogFileOption);