Refactor CLI command system to support async execution and central command history

This commit is contained in:
Stone_Red
2026-06-11 20:40:26 +02:00
parent 2b091e6e7c
commit 160d0559e8
14 changed files with 114 additions and 63 deletions
+2 -1
View File
@@ -9,7 +9,7 @@ public class ViewProcessLogs : ICommand
public string Description => "View logs for a process";
public void Execute(string? arguments, Action<string> printLine)
public Task ExecuteAsync(string? arguments, Action<string> printLine)
{
if (int.TryParse(arguments, out int processId))
{
@@ -21,6 +21,7 @@ public class ViewProcessLogs : ICommand
IEnumerable<LogEntry> logs = ProcessManager.GetLogs();
PrintLogs(logs, printLine);
}
return Task.CompletedTask;
}
private static void PrintLogs(IEnumerable<LogEntry> logs, Action<string> printLine)