Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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