From bd145bbabc9806106f3f2456d5b2100b64330be1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 23 Mar 2015 20:02:14 +0100 Subject: [PATCH] use %(default) in argparse --- artiq/frontend/artiq_master.py | 4 ++-- artiq/tools.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/artiq/frontend/artiq_master.py b/artiq/frontend/artiq_master.py index a41091feb..8c82de7c7 100755 --- a/artiq/frontend/artiq_master.py +++ b/artiq/frontend/artiq_master.py @@ -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 diff --git a/artiq/tools.py b/artiq/tools.py index 5455996e4..464c38c79 100644 --- a/artiq/tools.py +++ b/artiq/tools.py @@ -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):