Skip to content

Commit

Permalink
feat(cli): add graceful exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benex254 committed Jul 17, 2024
1 parent a88e72e commit cf3a963
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fastanime/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import signal

import click

from .. import __version__
Expand All @@ -17,6 +19,19 @@
}


# 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",
Expand Down

0 comments on commit cf3a963

Please sign in to comment.