Add the exit interrupt and the exit message.

main
KKlochko 1 year ago
parent b0ffba3c2e
commit 115e9188b9

@ -10,3 +10,10 @@ class MessagePrinter:
console.print(Markdown(full_message))
@staticmethod
def bye():
console = Console()
console.print('[green]bye[/]')

@ -18,7 +18,10 @@
###############################################################################
import asyncio
import sys
import typer
from notification_client.MessagePrinter import MessagePrinter
from notification_client.client import Client
cli_app = typer.Typer(rich_markup_mode="rich")
@ -40,5 +43,9 @@ def up(
This command [b]start[/] the [yellow b]client[/] and connects to the notification server.
"""
try:
client = Client(ip, port)
asyncio.run(client.connect())
except KeyboardInterrupt:
MessagePrinter.bye()
sys.exit(0)

Loading…
Cancel
Save