dry-rb / dry-cli

General purpose Command Line Interface (CLI) framework for Ruby
https://dry-rb.org/gems/dry-cli
MIT License
327 stars 41 forks source link

103 Safely rescue interrupts #109

Closed IvanShamatov closed 3 years ago

IvanShamatov commented 3 years ago

Resolves #103

If a ruby program is interrupted by Ctrl^C or sent a SIGINT signal, the Interrupt exception is raised, causing an ugly backtrace to be printed. Ideally, Dry::CLI should rescue Interrupt and exit with a status of 130 (see: https://tldp.org/LDP/abs/html/exitcodes.html).

Now works as expected