diff --git a/ModpackUpdater/ModpackUpdater.csproj b/ModpackUpdater/ModpackUpdater.csproj index 3901c19..17e02a8 100644 --- a/ModpackUpdater/ModpackUpdater.csproj +++ b/ModpackUpdater/ModpackUpdater.csproj @@ -56,6 +56,7 @@ + diff --git a/ModpackUpdater/Options.cs b/ModpackUpdater/Options.cs new file mode 100644 index 0000000..08e63c8 --- /dev/null +++ b/ModpackUpdater/Options.cs @@ -0,0 +1,25 @@ +using Mono.Options; + +namespace ModpackUpdater; + +internal class Options +{ + private readonly List additionals = []; + + public IReadOnlyList Additionals => additionals; + public bool InstallWithoutUi { get; private set; } + public string ProfileFolder { get; private set; } + public string ModpackConfig { get; private set; } + + public Options(string[] args) + { + var options = new OptionSet + { + { "i", "Install without user interface.", n => InstallWithoutUi = n != null }, + { "p|profile=", "Sets the minecraft profile folder.", p => ProfileFolder = p }, + { "c|config=", "Sets the minecraft profile folder.", c => ModpackConfig = c }, + }; + + var additional = options.Parse(args); + } +} diff --git a/ModpackUpdater/Program.cs b/ModpackUpdater/Program.cs index bd5938e..a60a921 100644 --- a/ModpackUpdater/Program.cs +++ b/ModpackUpdater/Program.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using Mono.Options; +using Newtonsoft.Json; using Pilz.Configuration; using Telerik.WinControls; @@ -17,6 +18,15 @@ public static class Program } internal static void Main(string[] args) + { + var options = new Options(args); + if (options.InstallWithoutUi) + InstallWithoutGui(options.ProfileFolder, options.ModpackConfig); + else + RunApp(); + } + + private static void RunApp() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -58,4 +68,9 @@ public static class Program // Delete legacy config file File.Delete(settingsPath); } + + private static void InstallWithoutGui(string profileFolder, string modpackConfig) + { + + } }