diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2021-08-25 11:25:01 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-08-25 15:46:00 +1000 |
commit | be43164d82dcfeb255a79c506b784185d3724bd1 (patch) | |
tree | d7ccd41584c627c6bc6a7613af67d66b2f42797d /tools/pyboard.py | |
parent | 2a290bbfe18929fdd00e24d937d9dfc6530eb874 (diff) | |
download | micropython-be43164d82dcfeb255a79c506b784185d3724bd1.tar.gz micropython-be43164d82dcfeb255a79c506b784185d3724bd1.zip |
tools/pyboard.py: Make --no-follow use same variable as --follow.
You can set one or the other (or neither) but not both.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index 2608cb2a02..44f205dad9 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -665,12 +665,13 @@ def main(): group.add_argument( "--follow", action="store_true", + default=None, help="follow the output after running the scripts [default if no scripts given]", ) group.add_argument( "--no-follow", - action="store_true", - help="Do not follow the output after running the scripts.", + action="store_false", + dest="follow", ) cmd_parser.add_argument( "--no-exclusive", @@ -709,13 +710,13 @@ def main(): def execbuffer(buf): try: - if args.no_follow: - pyb.exec_raw_no_follow(buf) - ret_err = None - else: + if args.follow is None or args.follow: ret, ret_err = pyb.exec_raw( buf, timeout=None, data_consumer=stdout_write_bytes ) + else: + pyb.exec_raw_no_follow(buf) + ret_err = None except PyboardError as er: print(er) pyb.close() |