Add CLI process and GUI start/stop commands with process management

This commit is contained in:
Stone_Red
2026-06-09 22:55:51 +02:00
parent f7eea21de5
commit a583a5ab44
4 changed files with 108 additions and 30 deletions
+33
View File
@@ -0,0 +1,33 @@
using RemSox.Processing;
using RemSox.UI.CLI;
namespace RemSox.Processes;
internal class CliProcess() : Process("Cli")
{
internal override void Run(string[] args)
{
Console.Clear();
Console.WriteLine("Welcome RemSox!");
Console.WriteLine("Type 'help' to see available commands.");
while (!StopRequested)
{
Console.Write("> ");
string? input = Console.ReadLine();
if (string.IsNullOrWhiteSpace(input))
{
continue;
}
bool handled = CommandManager.TryExecute(input, line => Console.WriteLine(line));
if (!handled)
{
Console.WriteLine($"\"{input}\" is not a command");
}
}
}
}