From b43d2d2d9d7fe0769e065c7e6670ab320810c52b Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 15 Jun 2023 15:29:04 -0500 Subject: [PATCH] In watch.py, fixed --keep-open-paths typo, made --keep-open implicit sometimes So now: ./scripts/watch.py -K lfs.c ./script.sh Does the reasonable thing. --- scripts/watch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/watch.py b/scripts/watch.py index 548c3605..945d9c2f 100755 --- a/scripts/watch.py +++ b/scripts/watch.py @@ -143,6 +143,10 @@ def main(command, *, buffer=False, ignore_errors=False, exit_on_error=False): + # if we have keep_open_paths, assume user wanted keep_open + if keep_open_paths and not keep_open: + keep_open = True + returncode = 0 try: while True: @@ -202,7 +206,7 @@ def main(command, *, # try to inotifywait if keep_open and inotify_simple is not None: if keep_open_paths: - paths = set(keep_paths) + paths = set(keep_open_paths) else: # guess inotify paths from command paths = set() @@ -262,7 +266,8 @@ if __name__ == "__main__": '-K', '--keep-open-path', dest='keep_open_paths', action='append', - help="Use this path for inotify. Defaults to guessing.") + help="Use this path for inotify. Defaults to guessing. Implies " + "--keep-open.") parser.add_argument( '-b', '--buffer', action='store_true',