MCPcopy
hub / github.com/GitGuardian/ggshield / before_exit

Function before_exit

ggshield/__main__.py:241–250  ·  view source on GitHub ↗

This function is launched as a final callback once subcommands have run. It executes some final functions and then terminates. The argument exit_code is the result of the previously executed click command.

(ctx: click.Context, exit_code: int, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

239@cli.result_callback()
240@click.pass_context
241def before_exit(ctx: click.Context, exit_code: int, *args: Any, **kwargs: Any) -> None:
242 """
243 This function is launched as a final callback once subcommands have run.
244 It executes some final functions and then terminates.
245 The argument exit_code is the result of the previously executed click command.
246 """
247 ctx_obj = ContextObj.get(ctx)
248 _display_deprecation_message(ctx_obj.config)
249 _check_for_updates(ctx_obj.check_for_updates)
250 sys.exit(exit_code)
251
252
253def force_utf8_output():

Callers

nothing calls this directly

Calls 3

_check_for_updatesFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected