You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
946 B

  1. #!/usr/bin/env python3.7
  2. from ChatInterface import ChatInterface
  3. from ChatConnection import ChatConnection
  4. if __name__ == "__main__":
  5. import argparse
  6. parser = argparse.ArgumentParser()
  7. parser.add_argument("host",
  8. metavar="HOST",
  9. help='Host IP to connect to.',
  10. type=str)
  11. parser.add_argument("port",
  12. metavar="PORT",
  13. help='Host PORT to connect to.',
  14. type=int)
  15. parser.add_argument("--name",
  16. metavar="NAME",
  17. help='Name you want to be identified as.',
  18. default='<anonymous>',
  19. type=str)
  20. args = parser.parse_args()
  21. try:
  22. ChatInterface(ChatConnection(args.host, args.port),
  23. name=args.name).start()
  24. except ConnectionRefusedError as e:
  25. print(e)