Add the exit interrupt and the exit message.
This commit is contained in:
@@ -10,3 +10,10 @@ class MessagePrinter:
|
|||||||
|
|
||||||
console.print(Markdown(full_message))
|
console.print(Markdown(full_message))
|
||||||
|
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def bye():
|
||||||
|
console = Console()
|
||||||
|
|
||||||
|
console.print('[green]bye[/]')
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import sys
|
||||||
import typer
|
import typer
|
||||||
|
from notification_client.MessagePrinter import MessagePrinter
|
||||||
|
|
||||||
from notification_client.client import Client
|
from notification_client.client import Client
|
||||||
|
|
||||||
cli_app = typer.Typer(rich_markup_mode="rich")
|
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.
|
This command [b]start[/] the [yellow b]client[/] and connects to the notification server.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
client = Client(ip, port)
|
client = Client(ip, port)
|
||||||
asyncio.run(client.connect())
|
asyncio.run(client.connect())
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
MessagePrinter.bye()
|
||||||
|
sys.exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user