Skip to content

Conversation

@greyli
Copy link
Contributor

@greyli greyli commented Aug 21, 2022

The alternative of #4778, fixes #4777

Using flask run with --debug is common usage, and adding this option to flask run makes the command more intuitive:

flask run --debug

If this change is accepted, then I will update the docs and add tests.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism
Copy link
Member

It's a bit confusing to have both --debug and --debugger flags, but I'm guessing most people don't know about the second flag anyway. This mostly matches the signature for app.run, which calls them debug and use_debugger.

@davidism davidism added this to the 2.2.3 milestone Aug 22, 2022
@greyli greyli changed the base branch from main to 2.2.x August 23, 2022 09:16
@greyli
Copy link
Contributor Author

greyli commented Aug 23, 2022

Rebased to 2.2.x and updated docs. I'm not sure if we need to add tests here, I was thinking something like this:

@pytest.mark.parametrize(
    "option,value",
    (
        (["--debug"], True),
        (["--no-debug"], False),
    )
)
def test_run_debug(option, value):
    ctx = run_command.make_context("run", option)
    assert ctx.params["debug"] == value

But it seems unnecessary.

@greyli
Copy link
Contributor Author

greyli commented Aug 23, 2022

It's a bit confusing to have both --debug and --debugger flags, but I'm guessing most people don't know about the second flag anyway. This mostly matches the signature for app.run, which calls them debug and use_debugger.

When this option was added, I think most people will use --debug over --reload and --debugger.

BTW, --reloader matches --debugger and use_reloader better. Do you think we need to rename --reload to --reloader?

@davidism davidism merged commit 229dcbb into pallets:2.2.x Dec 24, 2022
@davidism
Copy link
Member

I agree we should change reload to reloader as well, but I want to wait until Click can show a deprecation message for individual options.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI flask run describes that uses --debug to enable debugger and reloader, but flask run does not have the -- debug option

2 participants