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.
This commit is contained in:
Christopher Haster
2023-06-15 15:29:04 -05:00
parent b05db8e3d3
commit b43d2d2d9d
+7 -2
View File
@@ -143,6 +143,10 @@ def main(command, *,
buffer=False, buffer=False,
ignore_errors=False, ignore_errors=False,
exit_on_error=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 returncode = 0
try: try:
while True: while True:
@@ -202,7 +206,7 @@ def main(command, *,
# try to inotifywait # try to inotifywait
if keep_open and inotify_simple is not None: if keep_open and inotify_simple is not None:
if keep_open_paths: if keep_open_paths:
paths = set(keep_paths) paths = set(keep_open_paths)
else: else:
# guess inotify paths from command # guess inotify paths from command
paths = set() paths = set()
@@ -262,7 +266,8 @@ if __name__ == "__main__":
'-K', '--keep-open-path', '-K', '--keep-open-path',
dest='keep_open_paths', dest='keep_open_paths',
action='append', 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( parser.add_argument(
'-b', '--buffer', '-b', '--buffer',
action='store_true', action='store_true',