mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-08 07:46:29 +02:00
Add command interruption support with Ctrl+C and cancellation tokens
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user