[CLI] Update CliFx and use Spectre.Console for progress reporting

This commit is contained in:
Tyrrrz
2021-03-23 22:38:44 +02:00
parent 6f90c367b9
commit 017ed5ae6d
13 changed files with 193 additions and 121 deletions

View File

@@ -1,10 +1,10 @@
using System.Linq;
using System;
using System.Linq;
using System.Threading.Tasks;
using CliFx;
using CliFx.Attributes;
using CliFx.Infrastructure;
using DiscordChatExporter.Cli.Commands.Base;
using DiscordChatExporter.Core.Discord;
using DiscordChatExporter.Core.Discord.Data.Common;
using DiscordChatExporter.Core.Utils.Extensions;
namespace DiscordChatExporter.Cli.Commands
@@ -21,9 +21,18 @@ namespace DiscordChatExporter.Cli.Commands
foreach (var channel in channels.OrderBy(c => c.Category.Position).ThenBy(c => c.Name))
{
await console.Output.WriteLineAsync(
$"{channel.Id} | {channel.Category} / {channel.Name}"
);
// Channel ID
await console.Output.WriteAsync(channel.Id.ToString());
// Separator
using (console.WithForegroundColor(ConsoleColor.DarkGray))
await console.Output.WriteAsync(" | ");
// Channel category / name
using (console.WithForegroundColor(ConsoleColor.White))
await console.Output.WriteAsync($"{channel.Category} / {channel.Name}");
await console.Output.WriteLineAsync();
}
}
}