aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Program.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 28ef7279..183f8426 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -243,7 +243,17 @@ namespace slskd
// populate the properties above so that we can override the default config file if needed, and to
// check if the application is being run in command mode (run task and quit).
EnvironmentVariables.Populate(prefix: EnvironmentVariablePrefix);
+
+ try
+ {
Arguments.Populate(clearExistingValues: false);
+ }
+ catch (Exception ex)
+ {
+ // this is pretty hacky, but i don't have a good way of trapping errors that bubble up here.
+ Log.Error($"Invalid command line input: {ex.Message.Replace(". See inner exception for details.", string.Empty)}");
+ return;
+ }
// if a user has used one of the arguments above, perform the requested task, then quit
if (ShowVersion)