Code cleanup

This commit is contained in:
Stone_Red
2026-06-12 15:18:02 +02:00
parent 9f2aae3ba8
commit c70fd501bc
11 changed files with 735 additions and 707 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ public static class CommandManager
arguments = trimmedInput[commandName.Length..].TrimStart();
}
cancellationToken.Register(async () => await entry.Value.StopAsync());
CancellationTokenRegistration unused = cancellationToken.Register(async () => await entry.Value.StopAsync());
await entry.Value.ExecuteAsync(arguments, printLine);
return true;
+17 -22
View File
@@ -1,29 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RemSox.Processing;
namespace RemSox.UI.CLI.Commands
namespace RemSox.UI.CLI.Commands;
public class YesNtCommand : ICommand
{
public class YesNtCommand : ICommand
public string Name => "yesnt";
public string Description => "Start the YesNt interpreter";
private int processId;
public async Task ExecuteAsync(string? arguments, Action<string> printLine)
{
public string Name => "yesnt";
processId = ProcessManager.SpawnProcess<Processes.YesNtInterpreterProcess>(arguments?.Split(',') ?? []);
await ProcessManager.WaitForProcessExitAsync(processId);
}
public string Description => "Start the YesNt interpreter";
private int processId;
public async Task ExecuteAsync(string? arguments, Action<string> printLine)
{
processId = ProcessManager.SpawnProcess<Processes.YesNtInterpreterProcess>(arguments?.Split(',') ?? []);
await ProcessManager.WaitForProcessExitAsync(processId);
}
public Task StopAsync()
{
ProcessManager.StopProcess(processId);
return Task.CompletedTask;
}
public Task StopAsync()
{
ProcessManager.StopProcess(processId);
return Task.CompletedTask;
}
}
+4 -1
View File
@@ -24,5 +24,8 @@ public interface ICommand
/// <summary>
/// Interrupts the command if it's currently running. This is called when the user presses Ctrl+C in the CLI.
/// </summary>
Task StopAsync() => Task.CompletedTask;
Task StopAsync()
{
return Task.CompletedTask;
}
}