diff --git a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs index 1dfbdbc..d6a1076 100644 --- a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs +++ b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs @@ -20,34 +20,67 @@ namespace DiscordChatExporter.Cli.Commands.Base; public abstract class ExportCommandBase : TokenCommandBase { - [CommandOption("output", 'o', Description = "Output file or directory path.")] + [CommandOption( + "output", + 'o', + Description = "Output file or directory path." + )] public string OutputPath { get; init; } = Directory.GetCurrentDirectory(); - [CommandOption("format", 'f', Description = "Export format.")] + [CommandOption( + "format", + 'f', + Description = "Export format." + )] public ExportFormat ExportFormat { get; init; } = ExportFormat.HtmlDark; - [CommandOption("after", Description = "Only include messages sent after this date or message ID.")] + [CommandOption( + "after", + Description = "Only include messages sent after this date or message ID." + )] public Snowflake? After { get; init; } - [CommandOption("before", Description = "Only include messages sent before this date or message ID.")] + [CommandOption( + "before", + Description = "Only include messages sent before this date or message ID." + )] public Snowflake? Before { get; init; } - [CommandOption("partition", 'p', Description = "Split output into partitions, each limited to this number of messages (e.g. '100') or file size (e.g. '10mb').")] + [CommandOption( + "partition", + 'p', + Description = "Split output into partitions, each limited to this number of messages (e.g. '100') or file size (e.g. '10mb')." + )] public PartitionLimit PartitionLimit { get; init; } = PartitionLimit.Null; - [CommandOption("filter", Description = "Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image').")] + [CommandOption( + "filter", + Description = "Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image')." + )] public MessageFilter MessageFilter { get; init; } = MessageFilter.Null; - [CommandOption("parallel", Description = "Limits how many channels can be exported in parallel.")] + [CommandOption( + "parallel", + Description = "Limits how many channels can be exported in parallel." + )] public int ParallelLimit { get; init; } = 1; - [CommandOption("media", Description = "Download referenced media content.")] + [CommandOption( + "media", + Description = "Download referenced media content." + )] public bool ShouldDownloadMedia { get; init; } - [CommandOption("reuse-media", Description = "Reuse already existing media content to skip redundant downloads.")] + [CommandOption( + "reuse-media", + Description = "Reuse already existing media content to skip redundant downloads." + )] public bool ShouldReuseMedia { get; init; } - [CommandOption("dateformat", Description = "Format used when writing dates.")] + [CommandOption( + "dateformat", + Description = "Format used when writing dates." + )] public string DateFormat { get; init; } = "dd-MMM-yy hh:mm tt"; private ChannelExporter? _channelExporter; diff --git a/DiscordChatExporter.Cli/Commands/Base/TokenCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/TokenCommandBase.cs index fb15e81..5a2deb7 100644 --- a/DiscordChatExporter.Cli/Commands/Base/TokenCommandBase.cs +++ b/DiscordChatExporter.Cli/Commands/Base/TokenCommandBase.cs @@ -9,11 +9,22 @@ namespace DiscordChatExporter.Cli.Commands.Base; public abstract class TokenCommandBase : ICommand { - [CommandOption("token", 't', IsRequired = true, EnvironmentVariable = "DISCORD_TOKEN", Description = "Authentication token.")] + [CommandOption( + "token", + 't', + IsRequired = true, + EnvironmentVariable = "DISCORD_TOKEN", + Description = "Authentication token." + )] public string Token { get; init; } = ""; - [CommandOption("bot", 'b', EnvironmentVariable = "DISCORD_TOKEN_BOT", Description = "This option doesn't do anything. Kept for backwards compatibility.")] [Obsolete("This option doesn't do anything. Kept for backwards compatibility.")] + [CommandOption( + "bot", + 'b', + EnvironmentVariable = "DISCORD_TOKEN_BOT", + Description = "This option doesn't do anything. Kept for backwards compatibility." + )] public bool IsBotToken { get; init; } private DiscordClient? _discordClient; diff --git a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs index a88ed09..15a30be 100644 --- a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs @@ -10,7 +10,10 @@ namespace DiscordChatExporter.Cli.Commands; [Command("exportall", Description = "Export all accessible channels.")] public class ExportAllCommand : ExportCommandBase { - [CommandOption("include-dm", Description = "Include direct message channels.")] + [CommandOption( + "include-dm", + Description = "Include direct message channels." + )] public bool IncludeDirectMessages { get; init; } = true; public override async ValueTask ExecuteAsync(IConsole console) diff --git a/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs index d22a7a3..e61b265 100644 --- a/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs @@ -12,7 +12,12 @@ namespace DiscordChatExporter.Cli.Commands; public class ExportChannelsCommand : ExportCommandBase { // TODO: change this to plural (breaking change) - [CommandOption("channel", 'c', IsRequired = true, Description = "Channel ID(s).")] + [CommandOption( + "channel", + 'c', + IsRequired = true, + Description = "Channel ID(s)." + )] public IReadOnlyList ChannelIds { get; init; } = Array.Empty(); public override async ValueTask ExecuteAsync(IConsole console) diff --git a/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs b/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs index 4228e1a..b00e93b 100644 --- a/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs @@ -11,7 +11,12 @@ namespace DiscordChatExporter.Cli.Commands; [Command("exportguild", Description = "Export all channels within specified guild.")] public class ExportGuildCommand : ExportCommandBase { - [CommandOption("guild", 'g', IsRequired = true, Description = "Guild ID.")] + [CommandOption( + "guild", + 'g', + IsRequired = true, + Description = "Guild ID." + )] public Snowflake GuildId { get; init; } public override async ValueTask ExecuteAsync(IConsole console) diff --git a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs index 75fb62c..bc53677 100644 --- a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs @@ -12,7 +12,12 @@ namespace DiscordChatExporter.Cli.Commands; [Command("channels", Description = "Get the list of channels in a guild.")] public class GetChannelsCommand : TokenCommandBase { - [CommandOption("guild", 'g', IsRequired = true, Description = "Guild ID.")] + [CommandOption( + "guild", + 'g', + IsRequired = true, + Description = "Guild ID." + )] public Snowflake GuildId { get; init; } public override async ValueTask ExecuteAsync(IConsole console)