Skip to content

Commit 064a145

Browse files
jimmodpgeorge
authored andcommitted
tools/pyboard.py: Add --exclusive to match --no-exclusive.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent be43164 commit 064a145

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tools/pyboard.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,17 @@ def main():
673673
action="store_false",
674674
dest="follow",
675675
)
676-
cmd_parser.add_argument(
677-
"--no-exclusive",
676+
group = cmd_parser.add_mutually_exclusive_group()
677+
group.add_argument(
678+
"--exclusive",
678679
action="store_true",
679-
help="Do not try to open the serial device for exclusive access.",
680+
default=True,
681+
help="Open the serial device for exclusive access [default]",
682+
)
683+
group.add_argument(
684+
"--no-exclusive",
685+
action="store_false",
686+
dest="exclusive",
680687
)
681688
cmd_parser.add_argument(
682689
"-f",
@@ -691,7 +698,7 @@ def main():
691698
# open the connection to the pyboard
692699
try:
693700
pyb = Pyboard(
694-
args.device, args.baudrate, args.user, args.password, args.wait, not args.no_exclusive
701+
args.device, args.baudrate, args.user, args.password, args.wait, args.exclusive
695702
)
696703
except PyboardError as er:
697704
print(er)

0 commit comments

Comments
 (0)