(ctx: click.Context, param: click.Option, value: bool)
| 466 | |
| 467 | |
| 468 | def _set_debug(ctx: click.Context, param: click.Option, value: bool) -> bool | None: |
| 469 | # If the flag isn't provided, it will default to False. Don't use |
| 470 | # that, let debug be set by env in that case. |
| 471 | source = ctx.get_parameter_source(param.name) # type: ignore[arg-type] |
| 472 | |
| 473 | if source is not None and source in ( |
| 474 | ParameterSource.DEFAULT, |
| 475 | ParameterSource.DEFAULT_MAP, |
| 476 | ): |
| 477 | return None |
| 478 | |
| 479 | # Set with env var instead of ScriptInfo.load so that it can be |
| 480 | # accessed early during a factory function. |
| 481 | os.environ["FLASK_DEBUG"] = "1" if value else "0" |
| 482 | return value |
| 483 | |
| 484 | |
| 485 | _debug_option = click.Option( |
nothing calls this directly
no outgoing calls
no test coverage detected