MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / run_cli_async

Function run_cli_async

tortoise/cli/cli.py:850–866  ·  view source on GitHub ↗
(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

848
849
850async def run_cli_async(argv: list[str] | None = None) -> int:
851 parser = _build_parser()
852 try:
853 args = parser.parse_args(argv)
854 except SystemExit as exc:
855 return exc.code if isinstance(exc.code, int) else 1
856
857 ctx = CLIContext(config=args.config, config_file=args.config_file)
858 try:
859 await args.func(ctx, args)
860 except utils.CLIUsageError as exc:
861 print(str(exc), file=sys.stderr)
862 return 2
863 except utils.CLIError as exc:
864 print(str(exc), file=sys.stderr)
865 return 1
866 return 0
867
868
869def main() -> None:

Callers 1

mainFunction · 0.85

Calls 2

_build_parserFunction · 0.85
CLIContextClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…