From eb085becfaaef3f9dcabe9a8f608f34aac7744ed Mon Sep 17 00:00:00 2001 From: QingQiz Date: Fri, 2 Sep 2022 23:31:12 +0800 Subject: [PATCH] FEAT: Command line GUI --- BmsToOsu/BmsToOsu.csproj | 1 + BmsToOsu/Launcher/CliArgsLauncher.cs | 335 +++++++++++++++++++++++ BmsToOsu/Launcher/CliGuiLauncher.cs | 382 +++++++++++++++++++++++++++ BmsToOsu/Option.cs | 2 +- BmsToOsu/Program.cs | 339 +----------------------- BmsToOsu/Utils/Const.cs | 7 + README.md | 16 +- 7 files changed, 747 insertions(+), 335 deletions(-) create mode 100644 BmsToOsu/Launcher/CliArgsLauncher.cs create mode 100644 BmsToOsu/Launcher/CliGuiLauncher.cs create mode 100644 BmsToOsu/Utils/Const.cs diff --git a/BmsToOsu/BmsToOsu.csproj b/BmsToOsu/BmsToOsu.csproj index 3432428..1f627fe 100644 --- a/BmsToOsu/BmsToOsu.csproj +++ b/BmsToOsu/BmsToOsu.csproj @@ -11,6 +11,7 @@ + diff --git a/BmsToOsu/Launcher/CliArgsLauncher.cs b/BmsToOsu/Launcher/CliArgsLauncher.cs new file mode 100644 index 0000000..f2ef3a8 --- /dev/null +++ b/BmsToOsu/Launcher/CliArgsLauncher.cs @@ -0,0 +1,335 @@ +using System.IO.Compression; +using BmsToOsu.Converter; +using BmsToOsu.Entity; +using BmsToOsu.Utils; +using CommandLine; +using CommandLine.Text; +using log4net; + +namespace BmsToOsu.Launcher; + +public static class CliArgsLauncher +{ + private static readonly ILog Log = LogManager.GetLogger(nameof(CliArgsLauncher)); + + private static readonly string[] AvailableBmsExt = + { + ".bms", ".bml", ".bme", ".bmx" + }; + + public static void Launch(string[] args) + { + var argsParser = new Parser(with => + { + with.AutoVersion = false; + with.AutoHelp = true; + with.HelpWriter = null; + }); + + var result = argsParser.ParseArguments