This commit is contained in:
2024-06-20 06:30:24 +02:00
parent 00de4d8708
commit c31cc3aa20
6 changed files with 43 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
using Mono.Options;
using ModpackUpdater.Model;
using Mono.Options;
namespace ModpackUpdater;
@@ -9,6 +10,9 @@ internal class Options
public IReadOnlyList<string> Additionals => additionals;
public bool Silent { get; private set; }
public bool NoUi { get; private set; }
public bool NoUpdate { get; private set; };
public bool AllowUpdaterAfterInstall { get; private set; } = true;
public Side Side { get; private set; } = Side.Client;
public string ProfileFolder { get; private set; }
public string ModpackConfig { get; private set; }
@@ -16,10 +20,13 @@ internal class Options
{
var options = new OptionSet
{
{ "s|silent", "Do not output anything.", s => Silent = s != null },
{ "silent", "Do not output anything.", s => Silent = s != null },
{ "n|noui", "Install without user interface.", n => NoUi = n != null },
{ "p|profile=", "Sets the minecraft profile folder.", p => ProfileFolder = p },
{ "c|config=", "Sets the minecraft profile folder.", c => ModpackConfig = c },
{ "s|side=", "Sets the minecraft profile folder.\nDefault side is Client.\nAvailable: Client, Server", s => Side = Enum.Parse<Side>(s)},
{ "uai", "Allow an update directly after install. This only has affect if there is no existing installation.", uai => AllowUpdaterAfterInstall = uai != null},
{ "noupdate", "Skip the update check wich happens when opening the user interface.", noupdate => NoUpdate = noupdate != null},
};
var additional = options.Parse(args);