From a8274ce3b183de31d7be5188dacfd0fe1afb1f7f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 18 Dec 2021 16:30:44 -0600 Subject: add the ConfigurationFile property back --- src/slskd/Program.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index b109c76b..66729556 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -123,12 +123,19 @@ namespace slskd /// [Argument(default, "app-dir", "path where application data is saved")] [EnvironmentVariable("APP_DIR")] - public static string AppDirectory { get; private set; } = DefaultAppDirectory; + public static string AppDirectory { get; private set; } = null; /// /// Gets the fully qualified path to the application configuration file. /// - public static string ConfigurationFile => Path.Combine(AppDirectory, $"{AppName}.yml"); + [Argument('c', "config", "path to configuration file")] + [EnvironmentVariable("CONFIG")] + public static string ConfigurationFile { get; private set; } = null; + + /// + /// Gets the default fully qualified path to the configuration file. + /// + public static string DefaultConfigurationFile => Path.Combine(AppDirectory, $"{AppName}.yml"); /// /// Gets the default downloads directory. @@ -174,6 +181,9 @@ namespace slskd EnvironmentVariables.Populate(prefix: EnvironmentVariablePrefix); Arguments.Populate(clearExistingValues: false); + AppDirectory ??= DefaultAppDirectory; + ConfigurationFile ??= DefaultConfigurationFile; + if (ShowVersion) { Console.WriteLine(FullVersion); -- cgit v1.2.3