-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(derive): Provide derive-friendly deprecation messages #3832
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The main thing that might slip through is `bool`. We'll see if we an re-introduce that.
This is a step towards clap-rs#3822. I'd say this fixes it but I'd want some user acceptance before doing so.
This was referenced Jun 14, 2022
epage
referenced
this pull request
in ruma/ruma
Jun 15, 2022
epage
referenced
this pull request
in stencila/stencila
Jun 15, 2022
These should be able to be removed when upgrading to `clap` 4.0. This was done rather than adding numerous `#[clap(value_parser)]` attributes. See clap-rs/clap#3822.
epage
referenced
this pull request
in GitoxideLabs/gitoxide
Jun 15, 2022
I'd rather not have to deal with the new API because there is no problem with the old one for me. Once 4.0 becomes the default, the work has to be put in to probably achieve the same, but I hope it's not more wordy than before. I also hope that inconveniences will be figured out by the folks in the mean time. Related to clap-rs/clap#3822
This was referenced Jun 15, 2022
epage
referenced
this pull request
in sebastinas/drt-tools
Jun 15, 2022
clap >= 3.2 adds no value, so let them figure out what they want first. This sounds like change for the sake of change. See also clap-rs/clap#3822
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a step towards #3822. I'd say this fixes it but I'd want some
user acceptance before doing so.
To do this, we
ArgMatches
deprecation messages with assumption being that any message from these has its roots in anaugment_args
deprecation. You can see the raw deprecations withclap_derive/raw-deprecation
parse
case.Arg
methods, delegating to the messages for the generated functionsWe intentionally do not provide a deprecation message for implicit
parse
attributes since resolving that is just busywork that most likely won't help users in migrating to clap 4.I had originally assumed this would be difficult to be precise in our
allow
and deprecations but I found place to split up the calls. Its not completely precise but it should be good enough in the short term.Example messages
PathBuf
and correctly set theparse(from_os_str)
. Correctly detecting this to not show it would add another level of work and we'd need to have some way to tell users when they upgrade to clap 4 what the correct replacement forparse(from_os_str)
is (nothing).parse(from_str)
,. etc