From ae0d355d117e80506ec2f4f52c57b8805aa16d5e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 30 Jan 2021 16:50:42 -0600 Subject: rename Configuration to Options, refactor --- src/slskd/Options.cs | 234 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 src/slskd/Options.cs (limited to 'src/slskd/Options.cs') diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs new file mode 100644 index 00000000..9e6e6713 --- /dev/null +++ b/src/slskd/Options.cs @@ -0,0 +1,234 @@ +namespace slskd +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using YamlDotNet.Serialization; + + public record Option(char ShortName, string LongName, string EnvironmentVariable, Type Type, string Key, string Description = null) + { + public CommandLineArgument ToCommandLineArgument() + => new CommandLineArgument(ShortName, LongName, Type, Key, Description); + + public EnvironmentVariable ToEnvironmentVariable() + => new EnvironmentVariable(EnvironmentVariable, Type, Key, Description); + } + + public class Options + { + public static IEnumerable