From 15578dca1e2a107bf1dcb426dc3974f8ad6a5aa1 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Sat, 25 May 2024 19:17:37 +0300 Subject: [PATCH] Exposed env variables in the descriptions --- .../BUTR.NexusUploader.csproj | 2 +- .../Commands/ChangelogCommand.cs | 8 +++---- .../Commands/CheckCommand.cs | 4 ++-- .../Commands/RefreshCommand.cs | 2 +- .../Commands/UploadCommand.cs | 22 +++++++++++-------- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/BUTR.NexusUploader/BUTR.NexusUploader.csproj b/src/BUTR.NexusUploader/BUTR.NexusUploader.csproj index 4d153b7..88f52c2 100644 --- a/src/BUTR.NexusUploader/BUTR.NexusUploader.csproj +++ b/src/BUTR.NexusUploader/BUTR.NexusUploader.csproj @@ -4,7 +4,7 @@ Exe net6.0;net7.0;net8.0 embedded - 3.0.0 + 3.0.1 12 enable diff --git a/src/BUTR.NexusUploader/Commands/ChangelogCommand.cs b/src/BUTR.NexusUploader/Commands/ChangelogCommand.cs index 89eb9c0..c47a2d5 100644 --- a/src/BUTR.NexusUploader/Commands/ChangelogCommand.cs +++ b/src/BUTR.NexusUploader/Commands/ChangelogCommand.cs @@ -48,17 +48,17 @@ public class Settings : CommandSettings { [CommandOption("-k|--api-key")] [EnvironmentVariable("APIKEY")] - [Description("The NexusMods API key.")] + [Description("The NexusMods API key. Available Environment Variable: UNEX_APIKEY")] public string ApiKey { get; set; } = default!; [CommandOption("-g|--game")] [EnvironmentVariable("GAME")] - [Description("The NexusMods game name (domain) to upload the mod to. Can be found in the URL of the game page.")] + [Description("The NexusMods game name (domain) to upload the mod to. Can be found in the URL of the game page. Available Environment Variable: UNEX_GAME")] public string Game { get; set; } = default!; [CommandOption("-m|--mod-id")] [EnvironmentVariable("MODID")] - [Description("The NexusMods mod Id to update the changelog for.")] + [Description("The NexusMods mod Id to update the changelog for. Available Environment Variable: UNEX_MODID")] public int ModId { get; set; } = default!; [CommandArgument(0, "")] @@ -67,7 +67,7 @@ public class Settings : CommandSettings [CommandOption("-c|--changelog ")] [EnvironmentVariable("CHANGELOG")] - [Description("The changelog content to add.")] + [Description("The changelog content to add. Available Environment Variable: UNEX_CHANGELOG")] public string ChangelogContent { get; set; } = string.Empty; public override ValidationResult Validate() diff --git a/src/BUTR.NexusUploader/Commands/CheckCommand.cs b/src/BUTR.NexusUploader/Commands/CheckCommand.cs index 3dbf1ae..b5e0190 100644 --- a/src/BUTR.NexusUploader/Commands/CheckCommand.cs +++ b/src/BUTR.NexusUploader/Commands/CheckCommand.cs @@ -67,12 +67,12 @@ public class Settings : CommandSettings { [CommandOption("-k|--api-key")] [EnvironmentVariable("APIKEY")] - [Description("The NexusMods API key.")] + [Description("The NexusMods API key. Available Environment Variable: UNEX_APIKEY")] public string ApiKey { get; set; } = default!; [CommandOption("-s|--session-cookie")] [EnvironmentVariable("SESSION_COOKIE")] - [Description("Value of the 'nexusmods_session' cookie. Can be a file path or the raw cookie value.")] + [Description("Value of the 'nexusmods_session' cookie. Can be a file path or the raw cookie value. Available Environment Variable: UNEX_SESSION_COOKIE")] public string SessionCookie { get; set; } = default!; public override ValidationResult Validate() diff --git a/src/BUTR.NexusUploader/Commands/RefreshCommand.cs b/src/BUTR.NexusUploader/Commands/RefreshCommand.cs index 029f6fb..20a7573 100644 --- a/src/BUTR.NexusUploader/Commands/RefreshCommand.cs +++ b/src/BUTR.NexusUploader/Commands/RefreshCommand.cs @@ -43,7 +43,7 @@ public class Settings : CommandSettings { [CommandOption("-s|--session-cookie ")] [EnvironmentVariable("SESSION_COOKIE")] - [Description("Value of the 'nexusmods_session' cookie. Can be a file path or the raw cookie value.")] + [Description("Value of the 'nexusmods_session' cookie. Can be a file path or the raw cookie value. Available Environment Variable: UNEX_SESSION_COOKIE")] public string SessionCookie { get; set; } = default!; public override ValidationResult Validate() diff --git a/src/BUTR.NexusUploader/Commands/UploadCommand.cs b/src/BUTR.NexusUploader/Commands/UploadCommand.cs index 99426a1..53b8d4c 100644 --- a/src/BUTR.NexusUploader/Commands/UploadCommand.cs +++ b/src/BUTR.NexusUploader/Commands/UploadCommand.cs @@ -133,41 +133,45 @@ public class Settings : CommandSettings [CommandOption("-k|--api-key")] [EnvironmentVariable("APIKEY")] - [Description("The NexusMods API key.")] + [Description("The NexusMods API key. Available Environment Variable: UNEX_APIKEY")] public string ApiKey { get; set; } = default!; [CommandOption("-g|--game")] [EnvironmentVariable("GAME")] - [Description("The NexusMods game name (domain) to upload the mod to. Can be found in the URL of the game page.")] + [Description("The NexusMods game name (domain) to upload the mod to. Can be found in the URL of the game page. Available Environment Variable: UNEX_GAME")] public string Game { get; set; } = default!; [CommandOption("-f|--file-name")] [EnvironmentVariable("FILENAME")] - [Description("Name for the file on NexusMods.")] + [Description("Name for the file on NexusMods. Available Environment Variable: UNEX_FILENAME")] public string FileName { get; set; } = default!; [CommandOption("-v|--version ")] - [Description("Version for your uploaded file. May also update your main version.")] + [EnvironmentVariable("FILEVERSION")] + [Description("Version for your uploaded file. May also update your main version. Available Environment Variable: UNEX_FILEVERSION")] public string FileVersion { get; set; } = default!; [EnvironmentVariable("FILEDESCRIPTION")] - [Description("Description for the file on NexusMods.")] + [Description("Description for the file on NexusMods. Available Environment Variable: UNEX_FILEDESCRIPTION")] public string FileDescription { get; set; } = default!; [EnvironmentVariable("PREVIOUSFILE")] - [Description("Whether to remove the previous file.")] + [Description("The Id of the previous file to remove. Available Environment Variable: UNEX_PREVIOUSFILE")] public string PreviousFile { get; set; } = default!; [CommandOption("--remove-download-with-manager [value]")] - [Description("Removes the Download With Manager button")] + [EnvironmentVariable("REMOVEDOWNLOADWITHMANAGER")] + [Description("Removes the Download With Manager button. Available Environment Variable: UNEX_REMOVEDOWNLOADWITHMANAGER")] public FlagValue RemoveDownloadWithManager { get; set; } = default!; [CommandOption("--no-version-update [value]")] - [Description("Skips updating your mod's main version to match this file's version")] + [EnvironmentVariable("SKIPMAINVERSIONUPDATE")] + [Description("Skips updating your mod's main version to match this file's version. Available Environment Variable: UNEX_SKIPMAINVERSIONUPDATE")] public FlagValue SkipMainVersionUpdate { get; set; } = default!; [CommandOption("--set-main-vortex [value]")] - [Description("Sets this file as the main Vortex file (for the Download with Manager buttons)")] + [EnvironmentVariable("SETMAINVORTEXFILE")] + [Description("Sets this file as the main Vortex file (for the Download with Manager buttons). Available Environment Variable: UNEX_SETMAINVORTEXFILE")] public FlagValue SetMainVortexFile { get; set; } = default!; private bool AreSettingsValid() => ModFilePath.IsSet() && FileVersion.IsSet() && ApiKey.IsSet() && FileName.IsSet() && ModId != default;