项目文件夹

文件
Gregor Žunič 29fa06576c Print usage hint when bh is run on a TTY
A bare `bh` invocation blocks forever on sys.stdin.read(). Detect a TTY
stdin and exit with a one-line usage hint instead, so the failure mode
is obvious.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 22:19:47 -07:00

16 行
288 B
Python

import sys
from admin import ensure_daemon
from helpers import *
def main():
if sys.stdin.isatty():
sys.exit("bh reads Python from stdin. Use:\n bh <<'PY'\n print(page_info())\n PY")
ensure_daemon()
exec(sys.stdin.read())
if __name__ == "__main__":
main()