mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-01 18:38:16 +08:00
fixed line-endings
This commit is contained in:

committed by
Patrik Svensson

parent
989c0b9904
commit
44300c871f
@ -1,28 +1,28 @@
|
||||
namespace Spectre.Console.Tests.Data;
|
||||
|
||||
public sealed class AsynchronousCommand : AsyncCommand<AsynchronousCommandSettings>
|
||||
{
|
||||
private readonly IAnsiConsole _console;
|
||||
|
||||
public AsynchronousCommand(IAnsiConsole console)
|
||||
{
|
||||
_console = console;
|
||||
}
|
||||
|
||||
public async override Task<int> ExecuteAsync(CommandContext context, AsynchronousCommandSettings settings)
|
||||
{
|
||||
// Simulate a long running asynchronous task
|
||||
await Task.Delay(200);
|
||||
|
||||
if (settings.ThrowException)
|
||||
{
|
||||
throw new Exception($"Throwing exception asynchronously");
|
||||
}
|
||||
else
|
||||
{
|
||||
_console.WriteLine($"Finished executing asynchronously");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
namespace Spectre.Console.Tests.Data;
|
||||
|
||||
public sealed class AsynchronousCommand : AsyncCommand<AsynchronousCommandSettings>
|
||||
{
|
||||
private readonly IAnsiConsole _console;
|
||||
|
||||
public AsynchronousCommand(IAnsiConsole console)
|
||||
{
|
||||
_console = console;
|
||||
}
|
||||
|
||||
public async override Task<int> ExecuteAsync(CommandContext context, AsynchronousCommandSettings settings)
|
||||
{
|
||||
// Simulate a long running asynchronous task
|
||||
await Task.Delay(200);
|
||||
|
||||
if (settings.ThrowException)
|
||||
{
|
||||
throw new Exception($"Throwing exception asynchronously");
|
||||
}
|
||||
else
|
||||
{
|
||||
_console.WriteLine($"Finished executing asynchronously");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
using Spectre.Console;
|
||||
|
||||
public class GreeterCommand : Command<OptionalArgumentWithDefaultValueSettings>
|
||||
{
|
||||
private readonly IAnsiConsole _console;
|
||||
|
||||
public GreeterCommand(IAnsiConsole console)
|
||||
{
|
||||
_console = console;
|
||||
}
|
||||
|
||||
public override int Execute(CommandContext context, OptionalArgumentWithDefaultValueSettings settings)
|
||||
{
|
||||
_console.WriteLine(settings.Greeting);
|
||||
return 0;
|
||||
}
|
||||
using Spectre.Console;
|
||||
|
||||
public class GreeterCommand : Command<OptionalArgumentWithDefaultValueSettings>
|
||||
{
|
||||
private readonly IAnsiConsole _console;
|
||||
|
||||
public GreeterCommand(IAnsiConsole console)
|
||||
{
|
||||
_console = console;
|
||||
}
|
||||
|
||||
public override int Execute(CommandContext context, OptionalArgumentWithDefaultValueSettings settings)
|
||||
{
|
||||
_console.WriteLine(settings.Greeting);
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user