MCPcopy
hub / github.com/pallets/click / exit

Method exit

src/click/core.py:815–823  ·  src/click/core.py::Context.exit

Exits the application with a given exit code. .. versionchanged:: 8.2 Callbacks and context managers registered with :meth:`call_on_close` and :meth:`with_resource` are closed before exiting.

(self, code: int = 0)

Source from the content-addressed store, hash-verified

813 raise Abort()
814
815 def exit(self, code: int = 0) -> t.NoReturn:
816 class="st">"""Exits the application with a given exit code.
817
818 .. versionchanged:: 8.2
819 Callbacks and context managers registered with :meth:`call_on_close`
820 and :meth:`with_resource` are closed before exiting.
821 class="st">"""
822 self.close()
823 raise Exit(code)
824
825 def get_usage(self) -> str:
826 class="st">"""Helper method to get formatted usage string for the current

Callers 14

mainMethod · 0.80
callbackFunction · 0.80
show_helpFunction · 0.80
print_and_exitFunction · 0.80
cli_stringFunction · 0.80
cli_string_ctx_exitFunction · 0.80
cli_intFunction · 0.80
cli_int_ctx_exitFunction · 0.80
cli_floatFunction · 0.80
cli_float_ctx_exitFunction · 0.80
cliFunction · 0.80

Calls 2

closeMethod · 0.95
ExitClass · 0.85

Tested by 10

print_and_exitFunction · 0.64
cli_stringFunction · 0.64
cli_string_ctx_exitFunction · 0.64
cli_intFunction · 0.64
cli_int_ctx_exitFunction · 0.64
cli_floatFunction · 0.64
cli_float_ctx_exitFunction · 0.64
cliFunction · 0.64
set_stateMethod · 0.64
messing_with_loggerFunction · 0.64