Skip to content

Commit 145fede

Browse files
jimmodpgeorge
authored andcommitted
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>
1 parent 064a145 commit 145fede

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tools/pyboard.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,17 @@ def main():
655655
type=int,
656656
help="seconds to wait for USB connected board to become available",
657657
)
658-
cmd_parser.add_argument(
658+
group = cmd_parser.add_mutually_exclusive_group()
659+
group.add_argument(
659660
"--soft-reset",
660661
default=True,
661-
action=argparse.BooleanOptionalAction,
662-
help="Whether to perform a soft reset when connecting to the board.",
662+
action="store_true",
663+
help="Whether to perform a soft reset when connecting to the board [default]",
664+
)
665+
group.add_argument(
666+
"--no-soft-reset",
667+
action="store_false",
668+
dest="soft_reset",
663669
)
664670
group = cmd_parser.add_mutually_exclusive_group()
665671
group.add_argument(

0 commit comments

Comments
 (0)