mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
34 lines
783 B
C#
34 lines
783 B
C#
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");
|
|
}
|
|
}
|
|
}
|
|
}
|