aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-08-10 11:03:12 -0500
committerGitHub <noreply@github.com>2022-08-10 11:03:12 -0500
commite617b9bdf8d18633ec1e627b988793df161fa820 (patch)
tree3b37e7673638e644980f336278e86a1c95a556b2 /src/slskd/Core
parent4ba81ad7d51cdbe2a1bb9fb055f7d941c6061876 (diff)
parent7ae24ae93eb8c0c527a773acb9f4312a10f591bd (diff)
downloadslskd-e617b9bdf8d18633ec1e627b988793df161fa820.tar.gz
Merge pull request #581 from slskd/flags
Consolidate option "flags"
Diffstat (limited to 'src/slskd/Core')
-rw-r--r--src/slskd/Core/Options.cs102
1 files changed, 57 insertions, 45 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 197c3412..f2e89aeb 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -136,51 +136,6 @@ namespace slskd
public bool Debug { get; init; } = Debugger.IsAttached;
/// <summary>
- /// Gets a value indicating whether the logo should be suppressed on startup.
- /// </summary>
- [Argument('n', "no-logo")]
- [EnvironmentVariable("NO_LOGO")]
- [Description("suppress logo on startup")]
- [RequiresRestart]
- public bool NoLogo { get; init; } = false;
-
- /// <summary>
- /// Gets a value indicating whether the application should quit after initialization.
- /// </summary>
- [Argument('x', "no-start")]
- [EnvironmentVariable("NO_START")]
- [Description("quit the application after initialization")]
- [RequiresRestart]
- public bool NoStart { get; init; } = false;
-
- /// <summary>
- /// Gets a value indicating whether the application should connect to the Soulseek network on startup.
- /// </summary>
- [Argument(default, "no-connect")]
- [EnvironmentVariable("NO_CONNECT")]
- [Description("do not connect to the Soulseek network on startup")]
- [RequiresRestart]
- public bool NoConnect { get; init; } = false;
-
- /// <summary>
- /// Gets a value indicating whether the application should scan shared directories on startup.
- /// </summary>
- [Argument(default, "no-share-scan")]
- [EnvironmentVariable("NO_SHARE_SCAN")]
- [Description("do not scan shares on startup")]
- [RequiresRestart]
- public bool NoShareScan { get; init; } = false;
-
- /// <summary>
- /// Gets a value indicating whether the application should check for a newer version on startup.
- /// </summary>
- [Argument(default, "no-version-check")]
- [EnvironmentVariable("NO_VERSION_CHECK")]
- [Description("do not check for newer version at startup")]
- [RequiresRestart]
- public bool NoVersionCheck { get; init; } = false;
-
- /// <summary>
/// Gets a value indicating whether remote configuration of options is allowed.
/// </summary>
[Argument(default, "remote-configuration")]
@@ -198,6 +153,12 @@ namespace slskd
public string InstanceName { get; init; } = "default";
/// <summary>
+ /// Gets optional flags.
+ /// </summary>
+ [Validate]
+ public FlagsOptions Flags { get; init; } = new FlagsOptions();
+
+ /// <summary>
/// Gets the path where application data is saved.
/// </summary>
[Argument(default, "app")]
@@ -285,6 +246,57 @@ namespace slskd
public IntegrationOptions Integration { get; init; } = new IntegrationOptions();
/// <summary>
+ /// Optional flags.
+ /// </summary>
+ public class FlagsOptions
+ {
+ /// <summary>
+ /// Gets a value indicating whether the logo should be suppressed on startup.
+ /// </summary>
+ [Argument('n', "no-logo")]
+ [EnvironmentVariable("NO_LOGO")]
+ [Description("suppress logo on startup")]
+ [RequiresRestart]
+ public bool NoLogo { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should quit after initialization.
+ /// </summary>
+ [Argument('x', "no-start")]
+ [EnvironmentVariable("NO_START")]
+ [Description("quit the application after initialization")]
+ [RequiresRestart]
+ public bool NoStart { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should connect to the Soulseek network on startup.
+ /// </summary>
+ [Argument(default, "no-connect")]
+ [EnvironmentVariable("NO_CONNECT")]
+ [Description("do not connect to the Soulseek network on startup")]
+ [RequiresRestart]
+ public bool NoConnect { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should scan shared directories on startup.
+ /// </summary>
+ [Argument(default, "no-share-scan")]
+ [EnvironmentVariable("NO_SHARE_SCAN")]
+ [Description("do not scan shares on startup")]
+ [RequiresRestart]
+ public bool NoShareScan { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should check for a newer version on startup.
+ /// </summary>
+ [Argument(default, "no-version-check")]
+ [EnvironmentVariable("NO_VERSION_CHECK")]
+ [Description("do not check for newer version at startup")]
+ [RequiresRestart]
+ public bool NoVersionCheck { get; init; } = false;
+ }
+
+ /// <summary>
/// Directory options.
/// </summary>
public class DirectoriesOptions : IValidatableObject