Add command interruption support with Ctrl+C and cancellation tokens

This commit is contained in:
Stone_Red
2026-06-11 21:27:06 +02:00
parent cda4dcf097
commit 0968d64fa3
8 changed files with 55 additions and 16 deletions
+5
View File
@@ -20,4 +20,9 @@ public interface ICommand
/// <param name="arguments">The arguments provided to the command.</param>
/// <param name="printLine">A delegate to stream output lines to the current console or terminal.</param>
Task ExecuteAsync(string? arguments, Action<string> printLine);
/// <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;
}