diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-08-25 11:27:07 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-08-25 15:47:01 +1000 |
commit | 145fedef8d74a504c4b7c000e6c305602d07feff (patch) | |
tree | fefb865376154321a34cc670a789d0d390163a40 /tools/pyboard.py | |
parent | 064a145097790d07bf32e94a36931694b65dfb26 (diff) | |
download | micropython-145fedef8d74a504c4b7c000e6c305602d07feff.tar.gz micropython-145fedef8d74a504c4b7c000e6c305602d07feff.zip |
tools/pyboard.py: Make --no-soft-reset consistent with other args.
This makes it work like --no-follow and --no-exclusive using a mutex group
and dest. Although the current implementation with BooleanOptionAction is
neater it requires Python 3.9, so don't use this feature.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index 833fa7a41a..15ddfd745d 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -655,11 +655,17 @@ def main(): type=int, help="seconds to wait for USB connected board to become available", ) - cmd_parser.add_argument( + group = cmd_parser.add_mutually_exclusive_group() + group.add_argument( "--soft-reset", default=True, - action=argparse.BooleanOptionalAction, - help="Whether to perform a soft reset when connecting to the board.", + action="store_true", + help="Whether to perform a soft reset when connecting to the board [default]", + ) + group.add_argument( + "--no-soft-reset", + action="store_false", + dest="soft_reset", ) group = cmd_parser.add_mutually_exclusive_group() group.add_argument( |