mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 12:24:52 -08:00
feat(cli): add graceful exit
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user