INNER CODE UNIT · Python
_run
ohdearquant/lionagi · lionagi/cli/main.py:278
def _run(argv: list[str] | None = None) -> int:
# Resolve verbose before any CLI code emits (argparse hasn't run yet).
_argv = argv if argv is not None else sys.argv[1:]
# Scan only before the '--' sentinel so a scheduled action_prompt
# containing '--verbose' can't flip verbose mode.
try:
_sentinel_idx = _argv.index("--")
_pre_sentinel = _argv[:_sentinel_idx]
except ValueError:
_pre_sentinel = _argv
verbose = "-v" in _pre_sentinel or "--verbose" in _pre_sentinel
configure_cli_logging(verbose)
# Machine mode is answered before any other path can write to stdout, and
# never inferred from the terminal shape. The dispatcher owns stdout from
# here and emits one JSON object; everything human-facing goes to stderr.
if "--machine" in _pre_sentinel:
machine = _load_machine()