From 3a0f64fc7aafe9fa39f518aec389ef5f55b40007 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Wed, 25 Mar 2020 13:31:18 -0400 Subject: [PATCH] tools/pyboard.py: Add -d as an alias for --device. --- docs/reference/pyboard.py.rst | 8 ++++---- tools/pyboard.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/reference/pyboard.py.rst b/docs/reference/pyboard.py.rst index d7d6fae3f..d404c738f 100644 --- a/docs/reference/pyboard.py.rst +++ b/docs/reference/pyboard.py.rst @@ -24,8 +24,8 @@ Running ``pyboard.py --help`` gives the following output: .. code-block:: text - usage: pyboard [-h] [--device DEVICE] [-b BAUDRATE] [-u USER] - [-p PASSWORD] [-c COMMAND] [-w WAIT] [--follow] [-f] + usage: pyboard [-h] [-d DEVICE] [-b BAUDRATE] [-u USER] [-p PASSWORD] + [-c COMMAND] [-w WAIT] [--follow | --no-follow] [-f] [files [files ...]] Run scripts on the pyboard. @@ -35,8 +35,8 @@ Running ``pyboard.py --help`` gives the following output: optional arguments: -h, --help show this help message and exit - --device DEVICE the serial device or the IP address of the - pyboard + -d DEVICE, --device DEVICE + the serial device or the IP address of the pyboard -b BAUDRATE, --baudrate BAUDRATE the baud rate of the serial device -u USER, --user USER the telnet login username diff --git a/tools/pyboard.py b/tools/pyboard.py index 218436242..6376b13c7 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -557,6 +557,7 @@ def main(): cmd_parser = argparse.ArgumentParser(description="Run scripts on the pyboard.") cmd_parser.add_argument( + "-d", "--device", default=os.environ.get("PYBOARD_DEVICE", "/dev/ttyACM0"), help="the serial device or the IP address of the pyboard",