Add Spectre.Console support

This commit is contained in:
2021-06-04 20:39:41 +02:00
parent 97fe70085e
commit de2cfdb632
2 changed files with 20 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
<PackageReference Include="CliFx" Version="2.0.4" />
<PackageReference Include="Grpc.AspNetCore" Version="2.34.0" />
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="1.1.10" />
<PackageReference Include="Spectre.Console" Version="0.39.0" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,19 @@
using CliFx.Infrastructure;
using Spectre.Console;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Akari.Prototype.Server.Utils
{
public static class ConsoleExtensions
{
public static IAnsiConsole AsAnsiConsole(this IConsole console) => AnsiConsole.Create(new AnsiConsoleSettings
{
Ansi = AnsiSupport.Detect,
ColorSystem = ColorSystemSupport.Detect,
Out = new AnsiConsoleOutput(console.Output)
});
}
}