tools/pyboard.py: Add --exclusive to match --no-exclusive.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2021-08-25 11:25:43 +10:00 committed by Damien George
parent be43164d82
commit 064a145097
1 changed files with 11 additions and 4 deletions

View File

@ -673,10 +673,17 @@ def main():
action="store_false", action="store_false",
dest="follow", dest="follow",
) )
cmd_parser.add_argument( group = cmd_parser.add_mutually_exclusive_group()
"--no-exclusive", group.add_argument(
"--exclusive",
action="store_true", action="store_true",
help="Do not try to open the serial device for exclusive access.", default=True,
help="Open the serial device for exclusive access [default]",
)
group.add_argument(
"--no-exclusive",
action="store_false",
dest="exclusive",
) )
cmd_parser.add_argument( cmd_parser.add_argument(
"-f", "-f",
@ -691,7 +698,7 @@ def main():
# open the connection to the pyboard # open the connection to the pyboard
try: try:
pyb = Pyboard( pyb = Pyboard(
args.device, args.baudrate, args.user, args.password, args.wait, not args.no_exclusive args.device, args.baudrate, args.user, args.password, args.wait, args.exclusive
) )
except PyboardError as er: except PyboardError as er:
print(er) print(er)