-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Move --help
option defaults from its class to its decorator
#2840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
--help
option defaults from its class to its decorator
Remove custom HelpOption class. Refs: pallets/click#2563 pallets/click#2832 pallets/click#2840
Can you rebase this on stable then we can include this in 8.1.9? I assume we can keep this in 8.2.0, though we'll need to document it. |
Yes! I can rebase it to 8.1.9. I was targeting 8.2.0 as I didn't know if a 8.1.9 would see the light of day given that 8.2.0 seems imminent. Also, something I realized, when #2563 was merged back into Lines 1028 to 1035 in 8fcf9b0
So I felt like this PR, by targeting |
Approved with the suggestions I just commented. |
Removes `click.decorators.HelpOption` class. Closes #2832. # Conflicts: # CHANGES.rst
I just merged the changes proposed by @davidism and rebase this PR on top of All tests are passing but the So unless you have other issues to point to, I think this PR is ready to be merged upstream. |
This is a proposal to fix #2832, which points to a subtle change in behavior of the help option introduced in 8.1.8.
The root of the problem is that by deduplicating code in 8.1.8 (see: #2563), I introduced a
HelpOption
class, to centralize the setup necessary to make a standardOption
behave like an help option.In #2832, a user is relying on a custom class to feed the
@help_option
decorator. This bypass all the custom setup made byHelpOption
, and produce the discrepancy in behavior between 8.1.7 and 8.1.8.This PR:
HelpOption
class@help_option
implementation with the way Click is doing for the others (like@password_option
,@version_option
, ...)click.decorators.HelpOption
class as a consequenceChecklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.