From 162900144ac99e780d4151ecafe26987f367e81f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 16 Jan 2016 21:12:19 +0100 Subject: [PATCH] soc/tools/remove_server: cleanup --- litex/soc/tools/remote/server.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/litex/soc/tools/remote/server.py b/litex/soc/tools/remote/server.py index d455601c..2819905e 100644 --- a/litex/soc/tools/remote/server.py +++ b/litex/soc/tools/remote/server.py @@ -1,3 +1,4 @@ +import sys import socket import threading import argparse @@ -71,17 +72,21 @@ class RemoteServer(EtherboneIPC): self.serve_thread.start() -def _get_args(): +def _get_parser(): parser = argparse.ArgumentParser() parser.add_argument("--comm", default="uart", help="comm interface") - parser.add_argument("--port", default="2", help="UART port") + parser.add_argument("--port", help="UART port") parser.add_argument("--baudrate", default=115200, help="UART baudrate") parser.add_argument("--debug", action="store_true", help="enable debug") - return parser.parse_args() + return parser def main(): print("LiteX remote server") - args = _get_args() + parser = _get_parser() + if len(sys.argv) < 2: + parser.print_help() + sys.exit() + args = parser.parse_args() if args.comm == "uart": from litex.soc.tools.remote import CommUART print("Using CommUART, port: {} / baudrate: {}".format(args.port, args.baudrate)) -- 2.30.2