feat(cli): add graceful exit

This commit is contained in:
Benex254
2024-08-05 09:47:01 +03:00
parent 2b2a782b93
commit d51c7eb4ee

View File

@@ -1,3 +1,5 @@
import signal
import click
from .. import __version__
@@ -17,6 +19,19 @@ commands = {
}
# handle keyboard interupt
def handle_exit(signum, frame):
from .utils.tools import exit_app
from .utils.utils import clear
clear()
exit_app()
signal.signal(signal.SIGINT, handle_exit)
@click.group(
commands=commands,
help="A command line application for streaming anime that provides a complete and featureful interface",