From d74e6453f6a8196fb8155919c42e653fde562f54 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Tue, 7 Apr 2020 16:10:12 +0300 Subject: [PATCH] [CLI] Use environment variable fallbacks for token --- DiscordChatExporter.Cli/Commands/TokenCommandBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Cli/Commands/TokenCommandBase.cs b/DiscordChatExporter.Cli/Commands/TokenCommandBase.cs index 35f23c8e..101e79f3 100644 --- a/DiscordChatExporter.Cli/Commands/TokenCommandBase.cs +++ b/DiscordChatExporter.Cli/Commands/TokenCommandBase.cs @@ -10,10 +10,12 @@ namespace DiscordChatExporter.Cli.Commands { protected DataService DataService { get; } - [CommandOption("token", 't', IsRequired = true, Description = "Authorization token.")] + [CommandOption("token", 't', IsRequired = true, EnvironmentVariableName = "DISCORD_TOKEN", + Description = "Authorization token.")] public string TokenValue { get; set; } = ""; - [CommandOption("bot", 'b', Description = "Whether this authorization token belongs to a bot.")] + [CommandOption("bot", 'b', EnvironmentVariableName = "DISCORD_TOKEN_BOT", + Description = "Whether this authorization token belongs to a bot.")] public bool IsBotToken { get; set; } protected AuthToken Token => new AuthToken(IsBotToken ? AuthTokenType.Bot : AuthTokenType.User, TokenValue);