use %(default) in argparse

This commit is contained in:
Sebastien Bourdeauducq 2015-03-23 20:02:14 +01:00
parent b597483913
commit bd145bbabc
2 changed files with 3 additions and 4 deletions

View File

@ -22,10 +22,10 @@ def get_argparser():
help="hostname or IP address to bind to")
group.add_argument(
"--port-notify", default=3250, type=int,
help="TCP port to listen to for notifications (default: 3250)")
help="TCP port to listen to for notifications (default: %(default)d)")
group.add_argument(
"--port-control", default=3251, type=int,
help="TCP port to listen to for control (default: 3251)")
help="TCP port to listen to for control (default: %(default)d)")
verbosity_args(parser)
return parser

View File

@ -54,8 +54,7 @@ def simple_network_args(parser, default_port):
group.add_argument("--bind", default="::1",
help="hostname or IP address to bind to")
group.add_argument("-p", "--port", default=default_port, type=int,
help="TCP port to listen to (default: {})"
.format(default_port))
help="TCP port to listen to (default: %(default)d)")
def init_logger(args):