Files
CliFx/CliFx.Tests/TestCommands/CancellableCommand.cs
Alexey Golub 3883c831e9 Rework (#36)
2020-01-27 21:10:14 +02:00

16 lines
417 B
C#

using System;
using System.Threading.Tasks;
using CliFx.Attributes;
namespace CliFx.Tests.TestCommands
{
[Command("cancel")]
public class CancellableCommand : ICommand
{
public async ValueTask ExecuteAsync(IConsole console)
{
await Task.Delay(TimeSpan.FromSeconds(3), console.GetCancellationToken());
console.Output.WriteLine("Never printed");
}
}
}