-
Notifications
You must be signed in to change notification settings - Fork 117
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
Implement deprecated
for obsoleted options
#1791
Conversation
cb6cbcf
to
3a5d625
Compare
/packit test |
Hm, so it seems there is no |
I think there's already some old-click-only magic somewhere already... Anyway, how about not calling it "hidden" but rather "deprecated"? Then we'd express the goal in a declarative manner, marking the option as deprecated, leaving the hands of follow-up tools free to act differently. E.g. we could pass Maybe it could be a non-boolean option, maybe a string to carry tmt version, as in "deprecated since x.y"? A bit too verbose, but I included the answer to your question: with old Click, I'd add "deprecated" to the field |
Using |
I for one would prefer the string, Is it enough? :) |
You got me! :-) |
hidden
options in utils.field()
deprecated
for obsoleted options
Add a new class `Deprecated` and a new parameter `deprecated` to `tmt.utils.field()` to allow marking obsolete options with the version since when it should not be used and an optional hint with the recommended alternative. For example the following field: tmt.utils.field( option="--old-option" deprecated=Deprecated( since="1.23", hint="Use --something-else instead."), help="I'm doing this and that.") will produce this help message: --old-option I'm doing this and that. The option is deprecated since 1.23. Use --something-else instead. Also document the `multiple` parameter in the `field()` docstring.
Add a new class
Deprecated
and a new parameterdeprecated
totmt.utils.field()
to allow marking obsolete options with the version since when it should not be used and an optional hint with the recommended alternative.For example the following field:
will produce this help message:
Also document the
multiple
parameter in thefield()
docstring.