Skip to content

Commit

Permalink
Exposed env variables in the descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed May 25, 2024
1 parent ee9c8f2 commit 15578dc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/BUTR.NexusUploader/BUTR.NexusUploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<DebugType>embedded</DebugType>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>

Expand Down
8 changes: 4 additions & 4 deletions src/BUTR.NexusUploader/Commands/ChangelogCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<version>")]
Expand All @@ -67,7 +67,7 @@ public class Settings : CommandSettings

[CommandOption("-c|--changelog <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()
Expand Down
4 changes: 2 additions & 2 deletions src/BUTR.NexusUploader/Commands/CheckCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/BUTR.NexusUploader/Commands/RefreshCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Settings : CommandSettings
{
[CommandOption("-s|--session-cookie <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()
Expand Down
22 changes: 13 additions & 9 deletions src/BUTR.NexusUploader/Commands/UploadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <value>")]
[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<bool> 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<bool> 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<bool> SetMainVortexFile { get; set; } = default!;

private bool AreSettingsValid() => ModFilePath.IsSet() && FileVersion.IsSet() && ApiKey.IsSet() && FileName.IsSet() && ModId != default;
Expand Down

0 comments on commit 15578dc

Please sign in to comment.