From 39c66558cfedfbb28b11c37cd43ef39adcbe1d26 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 10 Feb 2021 08:27:36 -0600 Subject: more docs --- .../CommandLineConfigurationSource.cs | 24 +++------------------- 1 file changed, 3 insertions(+), 21 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 75ecadc4..088d5ea6 100644 --- a/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs +++ b/src/slskd/Common/Configuration/CommandLineConfigurationSource.cs @@ -15,7 +15,6 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // -#pragma warning disable SA1649 // File name should match first type name namespace slskd.Configuration { using System; @@ -32,7 +31,7 @@ namespace slskd.Configuration /// /// Extension methods for adding . /// - public static class CommandLineExtensions + public static class CommandLineConfigurationExtensions { /// /// Adds a command line argument configuration soruce to . @@ -40,11 +39,8 @@ namespace slskd.Configuration /// The to which to add. /// A list of command line argument mappings. /// The command line string from which to parse arguments. - /// - /// A value indicating whether configuration keys should be normalized (_, - removed, changed to lowercase). - /// /// The updated . - public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, IEnumerable map, string commandLine = null, bool normalizeKey = true) + public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, IEnumerable map, string commandLine = null) { if (builder == null) { @@ -55,7 +51,6 @@ namespace slskd.Configuration { s.Map = map; s.CommandLine = commandLine ?? Environment.CommandLine; - s.NormalizeKey = normalizeKey; }); } @@ -82,12 +77,10 @@ namespace slskd.Configuration { Map = source.Map; CommandLine = source.CommandLine; - NormalizeKey = source.NormalizeKey; } private string CommandLine { get; set; } private IEnumerable Map { get; set; } - private bool NormalizeKey { get; set; } /// /// Parses command line arguments from the specified string and maps them to the specified keys. @@ -100,11 +93,6 @@ namespace slskd.Configuration { var (shortName, longName, type, key, _) = item; - if (NormalizeKey) - { - key = key?.Replace("-", string.Empty).Replace("_", string.Empty).ToLowerInvariant(); - } - if (string.IsNullOrEmpty(key)) { continue; @@ -145,11 +133,6 @@ namespace slskd.Configuration /// public IEnumerable Map { get; set; } - /// - /// Gets or sets a value indicating whether configuration keys should be normalized (_, - removed, changed to lowercase). - /// - public bool NormalizeKey { get; set; } - /// /// Builds the for this source. /// @@ -157,5 +140,4 @@ namespace slskd.Configuration /// A . public IConfigurationProvider Build(IConfigurationBuilder builder) => new CommandLineConfigurationProvider(this); } -} -#pragma warning restore SA1649 // File name should match first type name \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3