Add the exit interrupt and the exit message.
This commit is contained in:
@@ -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.
|
||||
"""
|
||||
|
||||
client = Client(ip, port)
|
||||
asyncio.run(client.connect())
|
||||
try:
|
||||
client = Client(ip, port)
|
||||
asyncio.run(client.connect())
|
||||
except KeyboardInterrupt:
|
||||
MessagePrinter.bye()
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user