From: Florent Kermarrec Date: Sun, 14 Apr 2019 12:00:35 +0000 (+0200) Subject: litex_server: add message and exit when mandarory arguments are missing. X-Git-Tag: 24jan2021_ls180~1333^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be99083e2b64fc82d4398b9a16c29b10565742ae;p=litex.git litex_server: add message and exit when mandarory arguments are missing. --- diff --git a/litex/utils/litex_server.py b/litex/utils/litex_server.py index ba14d01d..b5dcb8f3 100755 --- a/litex/utils/litex_server.py +++ b/litex/utils/litex_server.py @@ -103,7 +103,7 @@ def main(): # UART arguments parser.add_argument("--uart", action="store_true", help="Select UART interface") - parser.add_argument("--uart-port", default="", + parser.add_argument("--uart-port", default=None, help="Set UART port") parser.add_argument("--uart-baudrate", default=115200, help="Set UART baudrate") @@ -119,13 +119,16 @@ def main(): # PCIe arguments parser.add_argument("--pcie", action="store_true", help="Select PCIe interface") - parser.add_argument("--pcie-bar", default="", + parser.add_argument("--pcie-bar", default=None, help="Set PCIe BAR") args = parser.parse_args() if args.uart: from litex.soc.tools.remote import CommUART + if args.uart_port is None: + print("Need to specify --uart-port, exiting.") + exit() uart_port = args.uart_port uart_baudrate = int(float(args.uart_baudrate)) print("[CommUART] port: {} / baudrate: {} / ".format(uart_port, uart_baudrate), end="") @@ -139,6 +142,9 @@ def main(): elif args.pcie: from litex.soc.tools.remote import CommPCIe pcie_bar = args.pcie_bar + if args.pcie_bar is None: + print("Need to speficy --pcie-bar, exiting.") + exit() print("[CommPCIe] bar: {} / ".format(args.pcie_bar), end="") comm = CommPCIe(args.pcie_bar) else: