Tried to write errors to stderr consistently in scripts

This commit is contained in:
Christopher Haster
2023-11-04 20:54:00 -05:00
parent d0a6ef0c89
commit 1e4d4cfdcf
19 changed files with 82 additions and 52 deletions

View File

@ -131,7 +131,8 @@ def main(path='-', *, lines=5, cat=False, sleep=None, keep_open=False):
# don't just flood open calls
time.sleep(sleep or 0.1)
except FileNotFoundError as e:
print("error: file not found %r" % path)
print("error: file not found %r" % path,
file=sys.stderr)
sys.exit(-1)
except KeyboardInterrupt:
pass