mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Add CLI process and GUI start/stop commands with process management
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user