mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-10-25 15:19:23 +00:00
Also raise CA2016 (forward the CancellationToken parameter to methods that take one) to warning Fixes #701
19 lines
485 B
C#
19 lines
485 B
C#
namespace Spectre.Console.Tests.Data;
|
|
|
|
public sealed class VersionCommand : Command<VersionSettings>
|
|
{
|
|
private readonly IAnsiConsole _console;
|
|
|
|
public VersionCommand(IAnsiConsole console)
|
|
{
|
|
_console = console;
|
|
}
|
|
|
|
public override int Execute(CommandContext context, VersionSettings settings, CancellationToken cancellationToken)
|
|
{
|
|
_console.WriteLine($"VersionCommand ran, Version: {settings.Version ?? string.Empty}");
|
|
|
|
return 0;
|
|
}
|
|
}
|