Tyrrrz / CliFx

Class-first framework for building command-line interfaces
MIT License
1.5k stars 61 forks source link

Handle Ctrl+C interrupt to perform cleanups #12

Closed Tyrrrz closed 5 years ago

Tyrrrz commented 5 years ago

Allow commands to handle execution interrupts to perform last chance cleanups before terminating

Tyrrrz commented 5 years ago

Idea: when Ctrl+C is called, cast the command to IDisposable and call IDisposable.Dispose() if it's implemented, right before killing the process.