summaryrefslogtreecommitdiffstatshomepage
path: root/tools/pyboard.py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-08-25 11:25:43 +1000
committerDamien George <damien@micropython.org>2021-08-25 15:46:38 +1000
commit064a145097790d07bf32e94a36931694b65dfb26 (patch)
tree1cf1bdc27a5a9497419a3894a42cd89bbff38745 /tools/pyboard.py
parentbe43164d82dcfeb255a79c506b784185d3724bd1 (diff)
downloadmicropython-064a145097790d07bf32e94a36931694b65dfb26.tar.gz
micropython-064a145097790d07bf32e94a36931694b65dfb26.zip
tools/pyboard.py: Add --exclusive to match --no-exclusive.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-xtools/pyboard.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py
index 44f205dad9..833fa7a41a 100755
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -673,10 +673,17 @@ def main():
action="store_false",
dest="follow",
)
- cmd_parser.add_argument(
- "--no-exclusive",
+ group = cmd_parser.add_mutually_exclusive_group()
+ group.add_argument(
+ "--exclusive",
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(
"-f",
@@ -691,7 +698,7 @@ def main():
# open the connection to the pyboard
try:
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:
print(er)