mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
`python -m cli.console -h` and `--help` now print a local usage summary and exit without importing `cli.console.repl`. The description covers the wrapper's behaviour (prefix stripping, help-alias handling, Ctrl+C semantics, exit tokens) so callers can discover the REPL surface without entering it. The repl import is moved into the run branch so the help path stays cheap and free of repl-side imports.
23 lines
634 B
Python
23 lines
634 B
Python
"""Interactive REPL for the infinito.nexus CLI (runs on the host)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
|
|
def _print_help() -> None:
|
|
print("usage: infinito console")
|
|
print()
|
|
print("Interactive REPL that forwards each line to the infinito CLI.")
|
|
print("Strips a leading 'infinito'/'cli' prefix, treats 'help'/'?' as --help,")
|
|
print("ignores Ctrl+C; exits on 'exit', 'quit', ':q', or Ctrl+D.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if any(arg in ("-h", "--help") for arg in sys.argv[1:]):
|
|
_print_help()
|
|
raise SystemExit(0)
|
|
from cli.console.repl import main
|
|
|
|
raise SystemExit(main())
|