diff --git a/CHANGES.rst b/CHANGES.rst index 82d2da6d..79e66e95 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,7 @@ Unreleased templates this behavior can be changed with the ``autoescape`` tag. :issue:`4831` - Fix the type of ``template_folder`` to accept ``pathlib.Path``. :issue:`4892` +- Add ``--debug`` option to the ``flask run`` command. :issue:`4777` Version 2.2.2 diff --git a/src/flask/cli.py b/src/flask/cli.py index 82fe8194..10e9c1e9 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -837,6 +837,11 @@ class SeparatedPathType(click.Path): expose_value=False, help="The key file to use when specifying a certificate.", ) +@click.option( + "--debug/--no-debug", + default=None, + help="Enable or disable the debug mode.", +) @click.option( "--reload/--no-reload", default=None, @@ -878,6 +883,7 @@ def run_command( info, host, port, + debug, reload, debugger, with_threads, @@ -910,7 +916,8 @@ def run_command( # command fails. raise e from None - debug = get_debug_flag() + if debug is None: + debug = get_debug_flag() if reload is None: reload = debug