aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordesvox <ofunknowndescent@gmail.com>2018-07-27 06:57:54 -0500
committerdesvox <ofunknowndescent@gmail.com>2018-07-27 06:57:54 -0500
commited8831c72880370e6c867eb2ab702344ad8a1bab (patch)
tree11c8a7b1757c69b22e414bdaa64af3afdb497fb8
parent33dd0a361d703ad4518886ca4b94fec6045c9b0e (diff)
downloadbbj-ed8831c72880370e6c867eb2ab702344ad8a1bab.tar.gz
add a --help option
-rw-r--r--clients/urwid/main.py14
1 files changed, 13 insertions, 1 deletions
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 <hostname>: the ip address/hostname/website/server to connect to
+ --port <port>: the port to use when connecting to the host
+ --user <username>: 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))
Un proyecto texto-plano.xyz