--no_python CLI arg to disable python check and implems

This commit is contained in:
N00MKRAD
2024-08-11 20:32:36 +02:00
parent 3138e7ffcf
commit 8df4e31b72
5 changed files with 27 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ using Flowframes.IO;
using Flowframes.MiscUtils;
using Flowframes.Os;
using Flowframes.Ui;
using NDesk.Options;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -49,6 +50,20 @@ namespace Flowframes
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
var opts = new OptionSet
{
{ "np|no_python", "Disable Python implementations", v => Implementations.DisablePython = v != null },
};
try
{
opts.Parse(Environment.GetCommandLineArgs());
}
catch (OptionException e)
{
Logger.Log($"Error parsing CLI option: {e.Message}", true);
}
Task.Run(() => DiskSpaceCheckLoop());
fileArgs = Environment.GetCommandLineArgs().Where(a => a[0] != '-' && File.Exists(a)).ToList().Skip(1).ToArray();
args = Environment.GetCommandLineArgs().Where(a => a[0] == '-').Select(x => x.Trim().Substring(1).ToLowerInvariant()).ToArray();