Skip to content

Commit

Permalink
(deps): Bump System.CommandLine (#4392)
Browse files Browse the repository at this point in the history
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored Jan 28, 2025
1 parent 792891d commit d3db023
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion new-cli/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="2.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.25071.2" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.25072.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.1" />
</ItemGroup>
</Project>
14 changes: 7 additions & 7 deletions new-cli/GitVersion.Cli.Generator/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand All @@ -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}}",
Expand Down Expand Up @@ -80,7 +80,7 @@ Task<int> Run(ParseResult parseResult, CancellationToken cancellationToken)
using {{InfraNamespaceName}};
namespace {{Namespace}};
public class RootCommandImpl : CliRootCommand
public class RootCommandImpl : RootCommand
{
public RootCommandImpl(IEnumerable<ICommandImpl> commands)
{
Expand All @@ -94,12 +94,12 @@ private void AddCommand(ICommandImpl command, IDictionary<string, ICommandImpl>
{
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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion new-cli/GitVersion.Cli/GitVersionApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class GitVersionApp(RootCommandImpl rootCommand)

public Task<int> RunAsync(string[] args, CancellationToken cancellationToken)
{
var cliConfiguration = new CliConfiguration(rootCommand);
var cliConfiguration = new CommandLineConfiguration(rootCommand);
var parseResult = cliConfiguration.Parse(args);

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

0 comments on commit d3db023

Please sign in to comment.