nat.cli.main#
Functions#
|
Process entrypoint for the |
Module Contents#
- run_cli() int | None#
Process entrypoint for the
natconsole script.Bootstraps
sys.pathso thenatpackage can be imported from a source checkout, then delegates to the Clickcligroup withstandalone_mode=Falseso the wrapper sees real exceptions (KeyboardInterrupt,click.Abort,click.ClickException) rather than the genericSystemExitthat standalone mode produces. Each branch records a singlenat_cli_commandtelemetry event vianat.cli.telemetry_hook.emit_command_event()before re-raising or callingsys.exit().- Side effects:
Sets
TRANSFORMERS_VERBOSITY=errorin the process environment.Appends the
packages/.../srcparent directory tosys.path.Replicates Click’s standalone-mode user-facing UX: prints the
"Aborted!"line on Ctrl-C /click.Abort; callsClickException.show()on usage errors.Emits exactly one telemetry event per invocation (success, failure, or interrupted), gated by the user’s persisted consent decision and the
NAT_TELEMETRY_ENABLEDenv var.
- Returns:
On the success path, the integer exit code if the invoked Click callback returned an int (Click’s convention for “exit with this code” without raising); otherwise
None(treated as exit 0 by the console-script wrapper’ssys.exit(...)). On every non-success path, the function does not return —SystemExitis re-raised after telemetry emission so the host process exits with the appropriate status code.- Raises:
- SystemExit: Re-raised after a telemetry event is emitted, so the
host process exits with the appropriate status code (0 on success /
--help, 1 on uncaught exception orclick.Abort, 2 onclick.UsageError, 130 onKeyboardInterrupt,exc.exit_codefor otherclick.ClickExceptionsubclasses).