From ed8831c72880370e6c867eb2ab702344ad8a1bab Mon Sep 17 00:00:00 2001 From: desvox Date: Fri, 27 Jul 2018 06:57:54 -0500 Subject: [PATCH] add a --help option --- clients/urwid/main.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 229d03d..012b273 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -45,8 +45,20 @@ def get_arg(key, default=None, get_value=True): exit("invalid format for --" + key) return value +if get_arg("help", False, False): + print("""BBJ Urwid Client +Available options: + --help: this message + --https: enable use of https, requires host support + --host : the ip address/hostname/website/server to connect to + --port : the port to use when connecting to the host + --user : automatically connect with the given username""") + exit() + try: - network = BBJ(get_arg("host", "127.0.0.1"), get_arg("port", 7099), get_arg("https", False, False)) + network = BBJ(get_arg("host", "127.0.0.1"), + get_arg("port", 7099), + get_arg("https", False, False)) except URLError as e: # print the connection error in red exit("\033[0;31m%s\033[0m" % repr(e))