Basic CLI/batch support

-start - Auto-start interpolation if file was also given
-quit-when-done - Auto-quit after task or queue
-factor - Interpolation factor (2/4/8)
-ai - Interpolation AI by dropdown index
-output-mode - Export mode by dropdown index
-model - AI model by dropdown index
This commit is contained in:
n00mkrad
2021-08-02 15:08:19 +02:00
parent e2cdb791fd
commit c3bdc27b94
7 changed files with 61 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ using Flowframes.MiscUtils;
using Flowframes.OS;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
@@ -17,7 +18,9 @@ namespace Flowframes
{
static class Program
{
public static string[] fileArgs = new string[0];
public static string[] args = new string[0];
public static bool initialRun = true;
public static Form1 mainForm;
public static bool busy = false;
@@ -40,8 +43,11 @@ namespace Flowframes
Networks.Init();
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();
Logger.Log($"Args: {(args.Length > 0 ? string.Join(", -", args) : "None")}", false);
Logger.Log($"Command Line: {Environment.CommandLine}", true);
Logger.Log($"Files: {(fileArgs.Length > 0 ? string.Join(", ", fileArgs) : "None")}", true);
Logger.Log($"Args: {(args.Length > 0 ? string.Join(", ", args) : "None")}", true);
LaunchMainForm();
}