Skip to content

Commit d3db023

Browse files
(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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 792891d commit d3db023

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

new-cli/Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
2121
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
2222
<PackageVersion Include="Serilog.Sinks.Map" Version="2.0.0" />
23-
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.25071.2" />
23+
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.25072.1" />
2424
<PackageVersion Include="System.Text.Json" Version="9.0.1" />
2525
</ItemGroup>
2626
</Project>

new-cli/GitVersion.Cli.Generator/Content.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class Content
2727
2828
namespace {{Namespace}};
2929
30-
public class {{Model.CommandTypeName}}Impl : CliCommand, ICommandImpl
30+
public class {{Model.CommandTypeName}}Impl : Command, ICommandImpl
3131
{
3232
public string CommandName => nameof({{Model.CommandTypeName}}Impl);
3333
{{- if (Model.ParentCommand | string.empty) }}
@@ -38,14 +38,14 @@ public class {{Model.CommandTypeName}}Impl : CliCommand, ICommandImpl
3838
{{- $settingsProperties = Model.SettingsProperties | array.sort "Name" }}
3939
// Options list
4040
{{~ for $prop in $settingsProperties ~}}
41-
protected readonly CliOption<{{$prop.TypeName}}> {{$prop.Name}}Option;
41+
protected readonly Option<{{$prop.TypeName}}> {{$prop.Name}}Option;
4242
{{~ end ~}}
4343
4444
public {{Model.CommandTypeName}}Impl({{Model.CommandTypeName}} command)
4545
: base("{{Model.CommandName}}", "{{Model.CommandDescription}}")
4646
{
4747
{{~ for $prop in $settingsProperties ~}}
48-
{{$prop.Name}}Option = new CliOption<{{$prop.TypeName}}>("{{$prop.OptionName}}", [{{$prop.Aliases}}])
48+
{{$prop.Name}}Option = new Option<{{$prop.TypeName}}>("{{$prop.OptionName}}", [{{$prop.Aliases}}])
4949
{
5050
Required = {{$prop.Required}},
5151
Description = "{{$prop.Description}}",
@@ -80,7 +80,7 @@ Task<int> Run(ParseResult parseResult, CancellationToken cancellationToken)
8080
using {{InfraNamespaceName}};
8181
namespace {{Namespace}};
8282
83-
public class RootCommandImpl : CliRootCommand
83+
public class RootCommandImpl : RootCommand
8484
{
8585
public RootCommandImpl(IEnumerable<ICommandImpl> commands)
8686
{
@@ -94,12 +94,12 @@ private void AddCommand(ICommandImpl command, IDictionary<string, ICommandImpl>
9494
{
9595
if (!string.IsNullOrWhiteSpace(command.ParentCommandName))
9696
{
97-
var parent = map[command.ParentCommandName] as CliCommand;
98-
parent?.Add((CliCommand)command);
97+
var parent = map[command.ParentCommandName] as Command;
98+
parent?.Add((Command)command);
9999
}
100100
else
101101
{
102-
Add((CliCommand)command);
102+
Add((Command)command);
103103
}
104104
}
105105
}

new-cli/GitVersion.Cli/GitVersionApp.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal class GitVersionApp(RootCommandImpl rootCommand)
1313

1414
public Task<int> RunAsync(string[] args, CancellationToken cancellationToken)
1515
{
16-
var cliConfiguration = new CliConfiguration(rootCommand);
16+
var cliConfiguration = new CommandLineConfiguration(rootCommand);
1717
var parseResult = cliConfiguration.Parse(args);
1818

1919
var logFile = parseResult.GetValue<FileInfo?>(GitVersionSettings.LogFileOption);

0 commit comments

Comments
 (0)