Commit a20a2d8e authored by Moul's avatar Moul
Browse files

[enh] Allow to only specify a domain name with `-p` option.

parent 9b4140e6
......@@ -46,7 +46,7 @@ def usage():
+ " currency with `https://"
+ G1_TEST_DEFAULT_ENDPOINT[0]
+ "` endpoint\
\n - custom endpoint can be specified with `-p` option followed by <domain>:<port>\
\n - custom endpoint can be specified with `-p` option followed by <domain>:<port> or <domain> with 443 as default port\
\n \
\nCommands: \
\n - info: Display information about currency \
......
......@@ -81,7 +81,11 @@ class EndPoint(object):
cli_args = Command()
ep = dict()
if cli_args.contains_switches("p"):
ep["domain"], ep["port"] = cli_args.get_definition("p").rsplit(":", 1)
peer = cli_args.get_definition("p")
if ":" in peer:
ep["domain"], ep["port"] = peer.rsplit(":", 1)
else:
ep["domain"], ep["port"] = peer, "443"
else:
ep["domain"], ep["port"] = (
G1_TEST_DEFAULT_ENDPOINT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment