From 0ee4fcbec326784f05ee2393d5f15f8755858ac8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 11 Feb 2021 20:20:13 -0600 Subject: use reflection instead of map --- .../CommandLineConfigurationSource.cs | 66 ++++++++++++++-------- 1 file changed, 42 insertions(+), 24 deletions(-) (limited to 'src/slskd/Common/Configuration/CommandLineConfigurationSource.cs') diff --git a/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs b/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs index 417e5729..28d9907d 100644 --- a/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs +++ b/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs @@ -18,8 +18,8 @@ namespace slskd.Configuration { using System; - using System.Collections.Generic; using System.Linq; + using System.Reflection; using Microsoft.Extensions.Configuration; using Utility.CommandLine; @@ -32,19 +32,24 @@ namespace slskd.Configuration /// Adds a command line argument configuration soruce to . /// /// The to which to add. - /// A list of command line argument mappings. + /// The type from which to map property values. /// The command line string from which to parse arguments. /// The updated . - public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, IEnumerable