#!/usr/bin/env python3.7
|
|
from ChatInterface import ChatInterface
|
|
from ChatConnection import ChatConnection
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("host",
|
|
metavar="HOST",
|
|
help='Host IP to connect to.',
|
|
type=str)
|
|
parser.add_argument("port",
|
|
metavar="PORT",
|
|
help='Host PORT to connect to.',
|
|
type=int)
|
|
parser.add_argument("--name",
|
|
metavar="NAME",
|
|
help='Name you want to be identified as.',
|
|
default='<anonymous>',
|
|
type=str)
|
|
args = parser.parse_args()
|
|
|
|
try:
|
|
ChatInterface(ChatConnection(args.host, args.port),
|
|
name=args.name).start()
|
|
except ConnectionRefusedError as e:
|
|
print(e)
|